From The TV IV
Canon is that part of a show that is considered factual in a show's universe. It consists of all events that appear on screen, including all visual imagery and all dialog. It does not normally include story elements from spin-offs such as novelisations and graphic novels, although there are exceptions to this. For example the BBC considers the Doctor Who online adventures to be canon, while Joss Whedon has stated that a forthcoming comic book series set in the Buffy universe is canon.
Being clear on what is and is not canon is crucial to analysing the intent of the writers when seeking to interpret a program. Something that is canon may still be open to interpretation, but by agreeing that it is canon, fans and other analysts have a secure base from which to launch interpretation.
A writer should think very carefully before contradicting canon, since fans often react badly to perceived changes that have not been adequately explained or foreshadowed. Canon is crucial in distinguishing reasonable speculation from fan wank, and badly executed canonical changes (or just inconsistent writing) make it more than possible to have canonical elements that appear to contradict each other. It is quite possible that there will be no canonical explanation for such contradictions, only fan wanks. For example, there are several inconsistencies in Dead Like Me as a consequence of the change of executive producer from Brian Fuller to John Masius with little or no attempt to resolve them within the show. For example it was hinted on screen that Clancy might be gay in the pilot, but this was never followed up and in later episodes he had an affair with a much younger female student.
Canon is more important to some genres than others. Science fiction and fantasy fans tend to take it very seriously because they generally like a universe to be consistent and, at the very least, expect them to have a strong internal logic. It is seen to be crucial to maintaining suspension of disbelief. However, soap opera fans are generally seen as less troubled by these matters and will not object to even impossible changes (the return of Den Watts in Eastenders several years after his body was positively identified by dental records being a case in point).
Of course, some shows - typically comedies - deliberate play fast and loose with canon, the best example perhaps being Red Dwarf which has many, many inconsistencies (and quite a few jokes about them), apparently decided entirely by what the writers felt was funny.