The slingshot effect, also known as the light-speed breakaway factor, was a method of time travel through the use of an artificially-created time warp. This maneuver was performed by traveling at an extremely high warp factor towards a massive body with a high gravitational attraction, such as a star. After allowing the gravitational pull to accelerate the vessel to even faster speeds, the vessel would then break away from the stellar body, creating a whiplash effect which could transport the vessel through time. Performing this maneuver required extremely precise calculations to be made, such as availability of fuel components, acceleration, and mass of a vessel through a time continuum. (TOS: "Tomorrow is Yesterday"; Star Trek IV: The Voyage Home)
In 2267, the Starship USS Enterprise accidentally traveled through time to the late 1960s, when an encounter with a previously-uncharted black star required the crew to utilize all warp power in reverse to break away from the star's powerful gravitational attraction, creating a whiplash effect. In order to return to their own time, the crew of the Enterprise recreated the accident, using the gravitational pull of Earth's sun to perform the slingshot. (TOS: "Tomorrow is Yesterday")
In 2286, Admiral Kirk and his command crew were forced to use the maneuver again, this time in the stolen Klingon Bird-of-Prey HMS Bounty, when an extremely powerful probe threatened to destroy Earth while attempting to contact by then-extinct humpback whales. To appease the probe, Kirk and crew used the slingshot effect to travel back in time to the late 20th century to retrieve two humpback whales. (Star Trek IV: The Voyage Home)
In 2365, Captain Jean-Luc Picard and Commander William Riker speculated on what phenomenon could have thrown the El-Baz back in time. While Riker knew the shuttlepod didn't have warp drive, he still suggested the theory that it could have somehow accelerated beyond warp 10. Picard suggested this could have been achieved by a warp-powered slingshot using the gravitational pull of a star. (TNG: "Time Squared")
Based on Star Trek IV The Voyage Home and "Tomorrow is Yesterday", going beyond warp 10 and creating a time warp are two stages in the slingshot effect. In Star Trek IV the time warp was generated after the ship had passed warp 9.8. While in "Tomorrow is Yesterday" going reverse through time already begins when the ship is approaching the stellar body at over the speed of warp 8. In the episode it is stated by Sulu, that the speed of the Enterprise goes "off the dial" for a moment after the ship has broken away from the star and reverses its direction in time to travel forward again, suggesting the ship does go "beyond infinite" at that point.
According to Star Trek Maps (pg.6), the speed increase that dislodges the ship from the space-time continuum in a slingshot effect is caused by a mathematical factor called the Cochrane's factor. It is added as a multiplier to the basic warp formula based on the amount of curvature of space the ship is traveling through. While the factor within the normal interstellar medium of Federation space is an average of 1292.7238 and in the intergalactic void only 1, in the close proximity of stars and other massive objects it is so high that these disproportionately high speeds are created.
In the novel Engines of Destiny, Scotty acquires another Bird-of-Prey and attempts to use the slingshot effect to travel back in time and prevent Kirk's death on the USS Enterprise-B. The maneuver itself is successful, but as a result, a timeline is created where the Borg have assimilated Earth (without Kirk in the Nexus, Jean-Luc Picard either failed to stop Tolian Soran's attempt to return to the Nexus or died in the process, and thus, without Picard's unique insight into the hive mind, the Borg assimilated Earth when they went back in time in Star Trek: First Contact, and it requires the intervention of the USS Enterprise-D to undo Scotty's mistake and return Kirk to the Nexus.
In the tenth anniversary special trilogy Star Trek: Deep Space Nine - Millennium, the USS Defiant accidentally slingshots around the Bajoran wormhole and is sent twenty-five years into the future; although unable to return by repeating the procedure- something that is apparently vital due to the time-travellers being 'out of sync' with the rest of the universe and therefore unable to use other time-travel methods to return home- before the Bajoran wormhole is merged with a red wormhole that was created as they departed, by entering a realm of non-linear time the crew are able to avert the creation of the red wormhole and erase the future they witnessed while returning to their time just before the destruction of Deep Space 9 in the past.
In the novel Forgotten History, it is revealed that, initially, the Enterprise was the only ship capable of performing a slingshot maneuver due to its engines being exposed to a unique set of conditions during their jump back in time after a cold start in "The Naked Time", resulting in the newly-formed Department of Temporal Investigations claiming the engines during the ship's refit to create a timeship. However, the knowledge of how to make any ship capable of performing a slingshot maneuver was revealed to Kirk by Agent Lucsly of the DTI when he was forced to work with Kirk during a malfunction of Timeship Two, which trapped them between 2273 and 2383.