Awhile back, I read a blurb on TVTropes saying that most Trek episodes are either based around Planet of Hats, Monster of the Week, or "Negative Space Wedgie" (basically the "anomaly" episodes). This seems a simplistic breakdown. I think we could make it better.
- Ship is in danger - Some sort of crisis takes place - be it an anomaly, space monster, or hostile alien life form - which threatens the ship (or station, in the case of DS9) with destruction. The issue is resolved by the end of the episode
- Cast is in danger - A variant of the above, where only one or a handful of main cast members are threatened with death, imprisonment, or other severe negative consequences. Often happens as the result of an "away mission" gone awry.
- Character focus - In the later series, Trek began throwing in episodes which did not always involve mortal danger, but allowed us to get deeper insight into a certain character. These kinds of episodes were particularly common on DS9, but were done fairly frequently on TNG and VOY as well
- Allegory/message - The episode has some sort of Deep Moral Lesson to teach us about ourselves. Often it does so introducing an alien civilization which is exactly like our own except for one weird trick, though other sci-fi concepts, like time travel, or even just the Federation setting, could be used. TOS was the king of these kinds of episodes, but they continued to be used in all later treks.
- Comedy - Episodes which while they might include some action involving danger to the ship and/or cast members, are played for laughs rather than drama.