In terms of "what is the literary canon," to paraphrase noted science-fiction author Samuel Delany (from his About Writing) the most practical marker of inclusion in the "canon" is when a work remains part of the living discourse, because of ongoing creation of an active body of derivative (adapted, parodied, modernized, retold) and secondary (critical, biographical, analytical) literature.
Thus, Romeo and Juliet is part of the canon, because a new movie version comes out every twenty years or so. The works of Toni Morrison are part of the canon, because new books about them and about her continue to be published. This definition is useful because it avoids value judgements on the relative worth of various works of literature, and focuses in on the objective, empirical traces of the quality of having been canonized. It also allows for work to go in and out of the canon, and traces how works might have originally entered the canon in the first place.
The other common literary meaning of "canon" is confirmed information about the characters or settings in work of fiction. The primary source of canon is the actual work itself (assuming there are no contradictions). The secondary source is what the author says (assuming that doesn't contradict what is in print). In the case of a large franchise, what is canon may be controlled by official sources produced by the franchise owner. Speculation by fans is not canon, unless confirmed by one of the routes above. What is canon is thus usually clear, except in the case of contradictions. The common factor between the terms is that both are based by analogy on the religious canon, the term for the officially endorsed sacred writings of a religion.