I had read in many places that the Bible was compiled during the Council of Nicea in 325 when the issue of the divinity of Jesus was finally made the official belief of the Church.
However, looking into this (doing a bit of Google) shows that the Council didn't select the books.
Credit is due to freza for setting me straight on this historical fact.
What I did find was very interesting - the sequence of canonisation was different amongst different Churches. Some Bibles have different books in the NT (I knew that Catholic Bibles had more books in the OT than Protestant books, but didn't know that Coptic Christians had more books in the NT, for example).
I came across a good summary here, which I thought I'd share:
The road to canonization of the New Testament was quite a bit rockier and quite the reverse of the Old. What ended in orthodoxy actually had its roots in heresy. While the Jews examined books to see if they were consistent with the main religious text (the Torah), the early Christians engaged in a more fundamental argument about what constituted Christianity and especially about the nature of Christ. Judaism was a centuries-old ancient religion with clear traditions. Christianity was new, had no tradition, and was torn with disagreement about what it was and what it should be.
The chief competitor to what would become mainstream Christianity was Gnosticism. The Gnostics believed that one did not need the intermediary of the church to experience God; that one could and should experience him firsthand if one knew the "secret tradition." One can easily see how this would threaten the orthodox church.
But the Gnostics did give one important idea to the church. A second century Gnostic named Marcion gave us the first list of books he felt appropriate for a New Testament. It was very short, including only an edited Gospel of Luke and some of Paul's letters. Marcion was also extremely anti-semitic and thought that Christianity should be completely divorced from Judaism, going so far as to say that Jesus was not born of Jewish parents but sprang full-grown from the mind of God.
None of Marcion's writings survived, having been expunged by the orthodox church. The only record we have of his activities are the church's attacks on him. But in setting out a canon he had planted an important seed. A literary fragment known as the Muratorian canon (named after Lodovico Muratori, who first recognized its importance) gave a list of possibly four Gospels and a major part of the rest of the New Testament. Other early Christian writers compiled other lists. Eventually church councils were held to determine a single set of books.
The first officially sanctioned canon of the New Testament was attempted by Irenaeus of Lyon. Irenaeus saw the effect Gnosticism was having on Christianity and feared that the church was splintering into factions. Formalizing doctrinal authority seemed to be the answer. He felt there were two sources of authority: Scripture and the apostles. A work could be accepted as canonical if the early church fathers used it. He never really compiled a list of books, but he did establish the basis for subsequent determinations of orthodoxy.
The work of Irenaeus was solidified by Bishop Eusebius some 150 years later, early in the 4th century AD. Eusebius was a prolific church historian who gave us most of what we know of early church history. He also gave us the first surviving list of New Testament books that matches what we have today, putting them in thematic order as well. Relying on the tradition of the church, Eusebius created what was probably the first Christian Bible as we know it today.
In 367 AD, Athanasius, bishop of Alexandria under Constantine the Great, set forth what proved to be the final canon of New Testament books in a letter listing 27 works. In 382 AD, at a synod held at Rome under Pope Damasus, church leaders influenced by Jerome adopted this list. The list was affirmed in councils at Hippo in 393 and 419 AD under Augustine and was officially ratified at a council in Rome around 473 AD. However, that council added no books that had not already been included in most earlier lists, and excluded no books that had not already been excluded by most lists.
The Greek Orthodox Church did not finalize its canon until the tenth century (primarily in doubt was inclusion of the book of Revelation). The Syrian Church had an even more complicated debate, and today recognizes only 22 books in its New Testament (excluding 2 Peter, 2 and 3 John, Jude, and Revelation). The Copts and Ethiopians have a few additional books included in their New Testament.