During the past 30 years of Star Trek, numerous books, comics, and other merchandise has filled the gaps left behind by the show. Often, the Star Trek universe presented in them differed radically from what was already established to be 'fact' in the show, mainly because there was so much fan produced material, that no one could keep track of them all. So now we have two kinds of Trek, one that is considered to be official, or canon by the producers of the show, and the non-canon, fan-produced material.
The definition of canon is simple. It is a collection of facts of the Star Trek universe every scriptwriter may be assumed to know, and be consistant with. An example of a canon fact is that the U.S.S Enterprise is a Constitution-class vessel. Usually, every fact mentioned in the show is considered to be canon.
Any fact stated in any of the books, comics, or the Animated Series is considered to be non-canon. An example of a non-canon fact is that the U.S.S Bonaventure, seen in "Time Trap" (The Animated Series) was the first warp capable ship of Earth.
To further confuse things, some facts which were once considered to be canon, are now non-canon. Early Treknologists in the 1970s relied almost exclusively on the "Star Fleet Technical Manual" by Franz Joseph, and at the time, it was considered to be canon. Later, Paramount executives and Mr. Joseph got into argument$, and the book was decanonised. This was only after several of Mr. Joseph's illustrations were used in Star Trek: The Motion Picture (in the bridge displays). Another example is the fact that if you listen carefully during the scene where the Epsilon 9 station broadcasts can be heard, the Dreadnought Entente, NCC-2020 can be heard mentioned briefly. Later versions of the movie have this line removed, since the name Entente was taken directly from "Star Fleet Technical Manual". So should the existance of the Entente (and with it, the existance of the Federation-class of ships, or the fact that Starfleet uses Dreadnoughts) be taken as canon?
Many Star Trek enthusiasts think that only canon facts should be allowed when speculating with like-minded individuals, and none of them should be omitted. They seem to feel that the only way to maintain consistancy is to consider only canon information. However, many canon facts, while being not entirely inconsistant, are at least ridiculous. How is it possible that the crew of the Voyager developed a transwarp drive (in "Threshold"), while the best scientists of the federation could not do it? Furthermore, it is clearly stated in the episode that warp 10 cannot be reached, while later dialogue states that it has been reached.
However, many fans consider canon and non-canon facts to be equal, where inconsistansies are dealed with the most rational way possible, and what cannot be explained, is discarded (sometimes, inconsistant facts are considered to be true, but in an alternate universe). Most notable example of this is the Star Trek Timeline created by James Dixon, which contains most every fact mentioned in any book, comic, movie or TV-show, in a well thought-of, consistant form.
Personally, I consider all cool facts about the Star Trek universe, be they canon or not, to be fact (fact as in the ST universe. I do know Star Trek isn't real). There are many non-canon sources which are better than any filmed material. Similarly, many facts that have been filmed, are pretty awful. My view of Star Trek is unique, and I think this is the way it should be.