Star Trek has played with crazy time-travel shenanigans more than any other franchise - yes, even Doctor Who. So it's no surprise there are at least half a dozen ways time travel works in Trek.
First of all, before I get hate mail/comments about the Doctor Who thing, here's what I mean. Yes that show's hero travels around in a time machine, so in a sense every episode is about time travel. And yet, most Who stories use the TARDIS to set up the story and then we're done with it. Doctor Who has done relatively few shows where time travel is fundamental to the story - "Day Of The Daleks" comes to mind, and so does "The Girl In The Fireplace" - whereas Trek has dipped into the time-travel-story well on a super regular basis.
1) Time-travel can change history - but only if you mess with someone "important." The very first Trek time-travel story is "Tomorrow Is Yesterday": the Enterprise accidentally kidnaps Air Force captain John Christopher, and he gains knowledge of the future that could change the present. (Kirk and Spock almost just remove Captain Christopher altogether, but they discover that his son heads a mission to Saturn. Christopher, himself, is totally worthless and wouldn't be missed.)
And in "City On The Edge Of Forever," a drug-crazed McCoy accidentally changes history so the Nazis win World War II, and as a result in the present, the Enterprise no longer exists. (This also seems to be the theory of time travel the new movie espouses, without getting too spoilery.) And of course, in the movie First Contact, the Borg temporarily succeed in going back and changing history, so that the 24th century Earth turns into a Borg hive — until the Enterprise goes back in time and stops them. Also in Deep Space Nine's "Past Tense," Sisko travels back to 2024 San Francisco, where he accidentally causes the death of civil-rights leader Gabriel Bell. Sisko winds up taking Bell's place, and Bell's picture in all the history books changes into Sisko's. Similarly, Sisko goes back in time to prevent a Klingon spy from assassinating Kirk in "Trials and Tribble-ations."
Also, people in alternate futures are able to go back and prevent their futures from ever "happening" in the DS9 episode "The Visitor" and the Voyager episodes "Timeless" and "End Game."
2) If you travel back in time, your mind will revert to its past state. Also in "Tomorrow Is Yesterday," the Enterprise drops off Christopher at the exact moment they originally kidnapped him, and somehow this leaves him with no memory of the intervening events. (Even though days have passed for him, he somehow loses all memory of them.) And in the episode "All Our Yesterdays," Spock travels back in time thousands of years to a barbaric ice age on another planet. And even though it's still the same Spock, he suddenly starts reverting to barbarism and acting like a crazay old-school Vulcan, with the heated desires and unbridled rage.
3) You can travel back in time, but you'll just become part of established events. In the episode "Assignment Earth," the Enterprise once again travels back to 1968 Earth, and this time Kirk and Spock try to stop the mysterious Gary Seven from launching, and detonating, a missile to stop the Cold-War arms race. Kirk and Spock nearly stop Gary Seven, but in the end, it turns out the missile blows up exactly 104 miles above Earth - just where it "always" did. So Kirk and Spock's time-traveling interference was "always" part of events. Also, in the TNG epsiode "Captain's Holiday," Picard destroys the super-magical device, the Uthat, that aliens from the future have stolen and brought back in time. And then the aliens say that Picard's decision to destroy the Uthat was already in their "historical records." Also, I'm guessing the Voyager episode "Future's End" belongs to this rule as well, because Henry Starling "invents" a whole bunch of technology that we always had in the 1990s, thanks to his exposure to 29th century tech.
4) Sometimes you have to travel in time just to make things happen the way they're "supposed" to. In the Next Generation episode "Time's Arrow," the Enterprise crew finds Data's severed head in the ground, dating back to the 19th century. As a result of this, Data goes back in time. Later, Guinan tells Picard that he needs to be part of the away team that goes back to 19th century San Francisco, because she remembers meeting Picard back then. Later, Data is decapitated, and his head winds up in the ground. Picard remarks that history is "fulfilling itelf." But at the same time, FutureGuinan won't tell Riker how to save Picard, for fear of changing history. So which is it?
5) Past, present and future are one. This seems to be the message of "All Good Things," the Next Generation finale. Picard's mind starts to "slip" from his present-day self to his "Encounter At Farpoint" self, and himself 25 years in the future. In all three eras, Picard journeys to the same point in space, where he orders a tachyon scan... which inadvertently creates a time/space anomaly that grows bigger the further back in time you go, so that billions of years in the past, it destroys the whole Alpha Quadrant. It seems as though Picard is seeing all three time periods as the same, with a unified causality, so that if he changes something in one era, it affects both other eras automatically. Ditto in "Tapestry," where Picard is able to make changes to his youthful mistakes from Starfleet Academy, and they instantly alter his life in the present. (This version is probably pretty similar to #1.)
6) If you blow up a time-travel device, all of the changes that a time-traveler has already made to history will be undone. This is the operating principle in Voyager's "Year Of Hell Part 2," where Janeway blows up the Krenim time machine and suddenly everything is returned to the way it was before the Krenim started meddling with time-travel. Also, Enterprise had a long-running storyline about the Temporal Cold War, in which four different groups from the future, including a future Federation, compete to change history. Eventually, the temporal shenanigans get crazier and crazier, with people going back and killing Lenin, and one alien engineering a timeline where the Nazis win World War II (it's always the Nazis winning World War II.) And at last, Captain Archer and his crew face Vosk, the biggest time-violator, in the alternate Nazi-dominated past, and succeed in destroying his temporal conduit. As soon as the device is destroyed, everything returns to normal.
Note: I realize there are at least a dozen or so other Star Trek episodes that involve time travel, which I haven't referenced in this article. You'll have to take my word for it that I considered all of them, and decided they fit in with one of the theories of time travel I mention here.
All screencaps are from TrekCore.