The canon of the Hebrew Scriptures was well established before Jesus was born. 1) The New Testament quotes from or alludes to every Old Testament book but two. 2) Jesus effectively endorsed the Hebrew canon in Matthew 23:35 when He cited one of the first narratives and one of the last in the Scriptures of His day. 3) The Jews were meticulous in preserving the Old Testament Scriptures, and they had few controversies over what parts belong or do not belong. The Roman Catholic Apocrypha did not measure up and fell outside the definition of Scripture and has never been accepted by the Jews.
The canon of Scripture was not created by the church; rather, the church discovered or recognized it. In other words, God's Word was inspired and authoritative from its inception - it "stands firm in the heavens" (Psalm 119:89) - and the church simply recognized that fact and accepted it. Jude verse 3 states that a Christian's faith “was once for all entrusted to the saints.”
Clement of Rome mentioned at least eight New Testament books (A.D. 95). Ignatius of Antioch acknowledged about seven books (A.D. 115). Polycarp, a disciple of John the apostle, acknowledged 15 books (A.D. 108). Later, Irenaeus mentioned 21 books (A.D. 185). Hippolytus recognized 22 books (A.D. 170-235). The New Testament books receiving the most controversy were Hebrews, James, 2 Peter, 2 John, and 3 John.
The first “canon” was the Muratorian Canon, which was compiled in A.D. 170. The Muratorian Canon included all of the New Testament books except Hebrews, James, and 3 John. In A.D. 363, the Council of Laodicea stated that only the Old Testament (along with the Apocrypha) and the 27 books of the New Testament were to be read in the churches. The Council of Hippo (A.D. 393) and the Council of Carthage (A.D. 397) also affirmed the same 27 books as authoritative.
The main events to do with Bible canon were:
100 AD Council of Rabbis at Jamnia produce Palestinian canon in Hebrew.
185 AD Irenaeus, Bishop of Lyons develops New Testament canon
The Council of Nicea in 325 AD had nothing to do with the Bible canon. Throughout the early centuries of the church, few books were ever disputed and the list was basically settled by A.D. 303.
It is God, through the power of the Holy Spirit, who inspired the writing of the Bible, and who has preserved his word right up until today. It is God, through the power of the Holy Spirit, who used the ancient Hebrew prophets and the first century Christians to bring together his holy and inspired word.
Catholic Christians together with Protestant and Evangelical Christians hold the same canon of the New Testament, 27 books, all having been originally written in the Greek language. Catholic Christians accept the longer Old Testament canon, 46 books, from the Greek Septuagint (LXX) translation of the Alexandrian Canon. Protestant and Evangelical Christians, from the Reformers onward, accept the shorter Old Testament canon, 39 books, from the Hebrew Palestinian Canon. Jews (God's chosen people) have the same canon as Protestants. I find that significant, don't you?
Please read the following links which answer the questions:
What is the canon of Scripture?
How and when was the canon of the Bible put together?
How do we decide which books belong in the Bible?
Who gave us the Scriptures?