Many things can be shared regarding how the books of the Bible have been determined; a few will be addressed here. For the Old Testament, the 39 books were collected together by about 400 BC in the time of Ezra the priest and scribe. These writings were affirmed as authoritative writings of the Jewish people inspired by God and used in their worship from ancient times. They included the Torah, revealed by God to Moses during the wilderness journey; Joshua and the books of history to follow; the wisdom books (mostly written during the times of David and his son Solomon); and the prophets. They were classified as the Torah, the Writings, and the Prophets or sometimes simply as the Law and the Prophets.
What determines canonicity or that a particular book is considered scriptural? How do we decide which books belong in the Bible since the Bible doesn't tell us?
In the New Testament, Jesus spoke of the inspired nature of these writings, saying, "Do not think that I have come to abolish the Law or the Prophets; I have not come to abolish them but to fulfill them. For truly, I say to you, until heaven and earth pass away, not an iota, not a dot, will pass from the Law until all is accomplished" (Matthew 5:17-18). He elsewhere referred to these writings as the Scriptures (Matthew 21:42; 22:29; 26:54).
Further support of the divine nature of the Old Testament writings is found in the abundance of quotations from and allusions to these writings in the New Testament. Both Jesus and the writers of the New Testament frequently refer to the Old Testament as authoritative, inspired writing.
But what about the New Testament? Each book was written by either an apostle or close associate of an apostle. These included three apostles of Jesus named Matthew, John, and Peter; the half-brothers of Jesus named James and Jude; and the writings of the apostle Paul. The other books were written by Mark (an associate of both Peter and Paul), Luke (an associate of Paul), and the author of Hebrews (whose unknown author was either Paul or one of his associates). Every New Testament book can be shown as directly from the family and followers of Jesus or a direct associate of them.
Their writings were accepted by the earliest churches as authoritative, inspired writings and were later included together as the New Testament along with the writings of the Old Testament. Some of the later letters were sometimes disputed, usually because they were not as widely known, yet were ultimately affirmed by the early church and its leaders as authoritative. Certain other works were sometimes included in some early New Testament collections until it was affirmed whether they were to be considered authoritative (such as the Shepherd of Hermas or the Didache).
By the early second century, most of the New Testament books were listed together as a collection. Entire New Testaments and Bibles featuring both testaments date to the early fourth century.
What is the canon of the Bible and how did we get it?
Could more books be added to the Bible?
When were the books of the Bible divided into chapters and verses? Who did the dividing?
What are the Catholic Apocrypha / Deuterocanonical books?
What is Verbal Plenary Inspiration?
Truth about the Bible