The Three Witnesses were Oliver Cowdery, David Whitmer, and Martin Harris, the three men shown the plates from which the Book of Mormon was translated. Their testimony was prophesied within the record itself: Nephi wrote that the book would be hidden from the world except that three witnesses would behold it by the power of God and testify to its truth (2 Nephi 27:12), and Moroni recorded that the plates would be shown to three who would know of a surety that the things were true (Ether 5:3).
In a revelation given through Joseph Smith, the Lord promised that the three would see the plates, the breastplate, the sword of Laban, the Urim and Thummim, and the directors given to Lehi in the wilderness, on condition that they rely on his word with full purpose of heart (Doctrine and Covenants 17:1). At their viewing an angel showed the plates and the voice of God declared that it was true.
Moroni further framed this witness as a formal judicial act: in the mouth of three witnesses the work is established, and their testimony stands together with the witness of the Father, the Son, and the Holy Ghost — a compound testimony declared to stand against the world at the last day (Ether 5:4).
All three later separated from the church for a time, but each continued to affirm his testimony of the Book of Mormon. Cowdery and Harris afterward returned to the church.