The Star Trek canon is the set of all canonical material in the Star Trek universe. The official Star Trek website defines canon as comprising the television series Star Trek: The Original Series, Star Trek: The Animated Series, Star Trek: The Next Generation, Star Trek: Deep Space Nine, Star Trek: Voyager, Star Trek: Enterprise, Star Trek: Discovery, and the films in the franchise. Editorials on the Star Trek website acknowledged that this definition is not set in stone, but that the notion of what constitutes canon in Star Trek is fluid, open to interpretation and debate.
As a rule, all Star Trek TV series that aired are considered canon. However, this policy does not make clear which version of the shows is the canon one. For example, the remastered TOS episodes released in 2006 present several visual differences from the episodes originally aired.
To further complicate matters, it has been noted that Gene Roddenberry was something of a revisionist when it came to canon. People who worked with Roddenberry remember that he used to handle canon not on a series-by-series basis nor an episode-by-episode basis, but point by point. If he changed his mind on something, or if a fact in one episode contradicted what he considered to be a more important fact in another episode, he had no problem declaring that specific point non-canon.
See, people can easily catch us, and say "well, wait a minute, in 'Balance of Terror', they knew that the Romulans had a cloaking device, and then in 'The Enterprise Incident', they don't know anything about cloaking devices, but they're gonna steal this one because it's obviously just been developed, so how the hell do you explain that?" We can't. There are some things we just can't explain, especially when it comes from the third season. So, yes, third season is canon up to the point of contradiction, or where it's just so bad... you know, we kind of cringe when people ask us, "well, what happened in 'Plato's Stepchildren', and 'And the Children Shall Lead', and 'Spock's Brain', and so on—it's like, please, he wasn't even producing it at that point. But, generally, [canon is] the original series, not really the animated, the first movie to a certain extent, the rest of the films in certain aspects but not in all... I know that it's very difficult to understand. It literally is point by point. I sometimes do not know how he's going to answer a question when I go into his office, I really do not always know, and—and I know it better probably than anybody, what it is that Gene likes and doesn't like.— Richard Arnold, 1991