Every few years, a news story will pop-up about someone finding "a lost book" of the Bible. Usually, these stories are good for a few clicks on the internet, and then nothing else is heard. Such stories do raise a question for curious minds though: how did we wind up with the Bible we have today? How do we know not to add new books to it? These questions also come up in youth group often. After all, if a child starts to study something, they will naturally have questions about it. So...how did we get the Bible we have today?
At the most basic level, we obtained the Bible we now know through consensus...or widespread agreement. The list of books that is recognized as being "official" by Christians is called the canon, from a Greek word meaning "reed"; this because reeds were used in ancient times as a measuring stick.
As one might imagine, the Old Testament came first, and Christians largely inherited it from Judaism. Christians primarily used the Greek translation of the Old Testament however, and as a result they came to include "apocryphal" books in the Bible...such as 1 & 2 Maccabees. These books were stripped from protestant Bibles some 1000 years later by Martin Luther, who judged the authority/importance of scripture based on its testimony of Christ. Thus, he had no use for the historically accurate but none-too-devotional Maccabees, the late-comer Sirach, and so forth.
The New Testament canon was formed in a somewhat more straightforward manner. The writings of the Apostle Paul were among the earliest Christian documents created, and were nearly universally accepted as authoritative. Until the persecution of Christians by the emperor Nero (64-68 AD) claimed the lives of the most illustrious apostles, there was no compelling need to have a written account of Christ. It did not take long for the gospels to come into being after this development however; the gospel of Mark was created in 67 AD, while the rest appeared over the course of the next 30 years.
Jesus proved to be a rather popular figure however, and there was a great deal of "Jesus fan-fiction" floating around. Throughout the Roman empire, churches utilized gospels, Paul's letters, and a mish-mash of Hebrews, the Shepherd of Hermas, Jude, 2 Peter, Revelation and so forth. The need for a more concrete list of official books came about as the result of a Roman heretic named Marcion. Expelled from his church for "defiling a virgin", Marcion started his own church and created a list of official books, including the gospel of Luke and 10 letters of Paul. Marcion was very anti-Jewish however, and the books he accepted were all heavily edited (by himself) to reflect a bias against Jews, as well as a preference for cult-ish, gnostic ideas.
In response to the danger to the faith presented by Marcion, councils were called, and some of the leading Bishops of the time put their heads together...eventually agreeing and accepting as authoritative the set of New Testament writings we now have today.