A canon is the closed and authoritative collection of a community's scriptures. The word is Greek for a measuring rod, and its application to a list of books is Christian and fourth-century in origin, though the phenomenon it names is older.
The Jewish canon of the Tanakh reached its three-part shape, Torah, Prophets, Writings, over a long period. The Torah was authoritative by the Persian period, the Prophets by roughly the second century BCE, and the Writings last, with disputes over particular books still recorded in rabbinic sources. The older account of a decisive "Council of Jamnia" around 90 CE fixing the canon has been abandoned by scholars, who now describe a gradual settling in which the destruction of the Temple, the growth of Christianity and the conviction that prophecy had ceased all played parts.
The Christian canon developed through the second to fourth centuries, and it was forced into the open by Marcion, whose rejection of the Hebrew scriptures and of most of the Gospels around 144 obliged the churches to say what they did accept. The Muratorian fragment preserves an early partial list; Origen and Eusebius record which books were accepted, disputed and rejected; and Athanasius' festal letter of 367 gives the first list of exactly the twenty-seven New Testament books now received. The criteria applied were apostolicity, orthodoxy of content, and widespread use among the churches, the last being decisive in practice, since the canon largely ratified what was already being read aloud. The Old Testament canon divided at the Reformation, with Protestants following the Hebrew canon and Catholics and Orthodox retaining the additional books of the Septuagint tradition; the Ethiopian Orthodox canon is broader still.
The Qur'an took a different course: an oral revelation collected under the early caliphs, with the standard consonantal text traditionally attributed to the caliph Uthman within about two decades of the Prophet's death, and vowel and diacritical marking added later. The relative speed and centralisation of that process distinguishes it sharply from the Jewish and Christian cases, and it is why Islamic canonical debate concerns readings and variants rather than which books belong.
Other traditions vary greatly. The Buddhist canon exists in several versions, Pali, Chinese, Tibetan, which differ in contents, and the Mahayana traditions never closed theirs as the Pali tradition did, which is precisely what makes the continued appearance of new sutras and of Tibetan terma possible. Hinduism has a foundational and closed Vedic corpus alongside an open and immense body of authoritative literature, with the distinction between shruti and smriti doing the work a canon does elsewhere. Sikhism's canon was closed by a Guru, which is unusually definite.
What the comparison reveals is a general pattern. Canons are typically closed in response to a challenge; they ratify existing use more often than they create it; and closing one both preserves a tradition and creates the interpretive problem of applying a fixed text to unforeseen circumstances, which is why every closed canon promptly generates a commentary tradition, and why the commentary often ends up carrying more practical authority than the canon.