In the Star Trek: Deep Space Nine episode "Trials and Tribble-ations," we meet the agency of Temporal Investigations. They mention that Captain Kirk has traveled through time on at least seventeen instances. What were those instances? I can think of Star Trek IV: The Voyage Home, possibly Generations, and "The City on the Edge of Forever". What are the other examples?
The actual line from the episode is:
LUCSLY: Seventeen separate temporal violations. The biggest file on record.
Importantly, a "violation" does not necessarily refer to an "instance of time travel"; indeed, Memory Alpha interprets this line to mean 17 specific actions taken in the course of time travel that violate temporal regulations (see the article on this episode, bottom on the "Trivia" section). Presumably, multiple violations could be incurred during a single time travel incident, just as multiple real-world laws could be broken during a single bank robbery.
These are all the occasions I know of on which Kirk traveled through time:
- "The Naked Time": The Enterprise is accidentally sent a few days backwards in time by the gravity well of a collapsing planet. Unclear if any "violations" were committed.
- "Tomorrow is Yesterday": The Enterprise passed too close to a "black star" and is thrown back to 1969 where they encounter the US air force. Many violations likely committed.
- "The City On The Edge of Forever": The Guardian of Forever sends Kirk, Spock and Bones back to the 1930's where McCoy severely alters history. Kirk endeavors to "correct" history, but hits a few bumps along the way.
- "Assignment: Earth": Kirk is sent back to 1969 by Starfleet to monitor Earth's history, but ends up interfering with history when he discovers that aliens are meddling in Earth's politics.
- "All Our Yesterdays": Kirk, Spock and Bones are accidentally sent back into the history of the planet Sarpedion. Unclear if any violations are committed.
- "Yesteryear": Kirk enters the Guardian of Forever to observe the birth of the Orion civilization. Unclear if any violations are committed. Spock goes back in time to save his own life, which sounds like interfering with the past to me, and he was under Kirk's command at the time.
- "Star Trek IV: The Voyage Home": despite saving the Federation in the process, taking creatures (including a human!) from the 20th century to the present probably constitute violations.
- "Star Trek: Generations": Kirk travels 80 years into the future by entering the Nexus. Unlikely that any violations were committed considering that he traveled into the future, not the past.
Additionally, while it's a bit of a stretch, Kirk existed at an accelerated time rate in "Wink of an Eye", and in "The Counter Clock Incident" the Enterprise enters a universe where time runs backwards and the crew (including Kirk) are de-aged.