I've read some places that Trek canon is open to debate. I've read other places that the television series and movies are canon while novels, comics and games are not. It seems to me it should be either one or the other. So what is Trek canon? Is it simply individual opinion or something that is easily defined? And how is/was it determined?
Canon refers to a complete body of work. But in the case of official canon recognized by the studios it is what is seen on the screen. So what has been shown on the TV shows and movie theaters is canon. Novels comics and games are not canon. However, we all have our personal canon and that can include anything we like.
Trek canon is the live action shows and movies. It's supposed to be the body of work that new Trek keeps consistant with. In cases of rewrites or retcons, new canon overwrites the old. The novels aren't canon, but they have their own ongoing continuity around and beyond the episodes and movies. Since there isn't going to be any new TV/film Trek in the TOS/TNG/DS9/VOY continuity, they're not going to be contradicted in the way that some older books were. There are a few episodes that have been mostly ignored or forgotten, like TOS: "The Alternative Factor" or VOY: "Threshold" - although there is no official list of what episodes are canon and what aren't, or which bits count and which don't. CBS don't take it as seriously as the Trek fans do. It's more or a loose mythology.
It's really no big deal. In practice, it just means that continuity flows downhill from the original screen versions, not the other way around. The books and comics and games have to be consistent with the screen versions, but the screen versions are not obliged to worry about what happens in the books and comics and so on. (Although sometimes you do get a bit of backwash where something from the books manages to get "canonized" in the films--as with Uhura's first name, which originated in the novels but did not become "canon" until it was finally used onscreen in the last movie.) Hope this makes sense. Ultimately, it's all just made up anyway, so fretting about which stories are more "canon" than others is kind of like arguing about how many Organians can dance on the head of a pin. An interesting exercise, but essentially pointless.
Canon is like this really, really big gun. Naw, just kidding. Like what was already said, official canon is what's been shown on screen: movies and tv. However, I personally prescribe to my own personal canon, which is guided by official canon. This means when I like something from books, and other "unoffical canon," I'll include it in my own personal canon, and in my own mind, even tweak the official canon stuff to be more to my own liking.
So...if there is something stated on one episode that contradicts something in another episode, both are canon even if they are not consistent?
Yes, both are canon. Canon is not about consistency. Canon is what ever CBS and/or Paramount say it is.
New canon overwrites old. For example, once Star Trek: Enterprise started, Archer's Enterprise NX-01 was the first Enterprise, even though Sisko previously said the first Enterprise was Kirk's ship in "Trials and Tribble-ations"
Yep! And you either quietly ignore the inconsistency or try to rationalize it somehow. There's no "official" process or authority to determine which episodes are more "canon" than others. And no episode or movie has ever been "officially" stricken from the continuity. In general, it's easier just to quietly forget about an inconsistency rather than make a big deal about it. When you're dealing with five live-action tv series, twelve movies (and counting) and several hundred novels and comic books and short stories and such, written by dozens of different people over the course of nearly fifty years, it's almost inevitable that the pieces aren't always going to fit together perfectly. That's just how it goes. Making TV is an art, not a science.
Trek canon = Onscreen history. History is constantly told and retold, and details change in the retelling. Both in Trek and in real life. It's all history but the details are fuzzy.
This is actually not an issue of canon, but of continuity--and in this instance, there really isn't a conflict of either. Even with ENT, Kirk's Enterprise remains the first Federation starship to bear the name and the Starfleet registry NCC-1701, which makes the comment in "Trials and Tribble-ations" still perfectly valid. Archer's Enterprise, on the other hand, was an Earth starship that was decommissioned prior to the formation of the Federation.
Canon is a little tweeting bird chirping in a meadow. Canon is a wreath of pretty flowers which smell BAD
And the best way to be. If you try to slavishly follow canon to the letter, where ALL onscreen is canon and correct, you'd have a nervous breakdown. Is Kirk's middle initial R or T? Why did Starfleet forget the Romulans had a cloaking device 2 years after they saw it? Was it's Spock's ancestor or mother who was human? Is Spock Vulcan or Vulcanian? Were the Klingons conquered by the Federation, or just became allies? Just accept that sometimes there are goofs, and spend time coming up with ways to explain inconsistances, but don't let yourself get too hung up on the details. The makers of the shows created TV to entertain, not to be pulled apart and studied, as we may study microbes that swarm and - oh wait, sorry, that's War of the Worlds...
Which is often overruled. Betazeds cannot sense the emotions of Ferengi--except when they did. Trills cannot use transporters, except when they do. Vulcan has no moons, except when it does. Etc. "Canon" is always a work-in-progress.