The canon of scripture are the accepted books of the Bible. The Protestant church has 66 books, 39 in the Old Testament and 27 on the New Testament. The Catholic, Anglican, Ethiopian, and Greek Orthodox churches all have additional books that they consider scriptural. These books are considered apocryphal as they are not unanimously supported but instead questioned by different sects of Christianity.
While many factors decided what ultimately is considered scripture some of it simply comes down to tradition. The early church recognized from the beginning that certain books and letters carried important significance and thus circulated books as such. Paul recognized that he was writing scripture but certainly not all of his writings were scripture. His letters to the Corinthians reference additional letters that he wrote that are not a part of the Bible and have not survived.
By the 400’s AD the canon of scripture was relatively settled with the 27 accepted books of the New Testament. All Christian churches agree on these books although different churches have the books in a slightly different order. The apocryphal books are all in the Old Testament of each church’s Bible.