A temporal causality loop (or simply causality loop) is a type of phenomenon whereby a specific moment in time repeats itself continually inside an independent fragment of time. (TNG: "Cause and Effect")
In 2278, the USS Bozeman encountered a temporal distortion, causing it to travel forward in time to the year 2368, where it encountered the USS Enterprise in the area of space known as the Typhon Expanse. When the Bozeman collided with the Enterprise, the resultant explosion, being in close proximity to the temporal distortion, ruptured the spacetime continuum, trapping both ships in a causality loop wherein the Enterprise continually encountered the Bozeman and was subsequently destroyed. Eventually, the Enterprise crew began to realize what was happening due to a sense of déjà vu they kept experiencing, as memories from previous loops began imprinting themselves to persons inside the loop. They devised a means whereby they could send a specific message into the next iteration of the loop via dekyon emission, where it was detected by Data's positronic subprocessors. The effort proved successful, and Data was able to use the transmitted information to avoid the collision with the Bozeman, thereby escaping from the loop. Altogether the Enterprise had spent 17.4 days inside the fragment of time. (TNG: "Cause and Effect")
In the episode ENT: "Future Tense", set in 2152, a loop phenomenon also occurred on Enterprise NX-01 when high-energy particles of temporal radiation leaked from a 31st century time ship to the launch bay where the ship was stored. Malcolm Reed and Trip began to relive half a minute of time over and over again. T'Pol, who at the time didn't believe in the possibility of time travel, suggested that alternatively they may have only perceived time as if they were reliving it. In the case, the two men began to realize what was happening due to a sense of déjà vu and eventually clearer memories from previous loops. The phenomenon was proven to be a loop when Jonathan Archer and Reed also began to relive a moment of time later when they entered the bay. The men were able to launch the time ship away from the launch bay eventually breaking the loop. The phenomenon wasn't given a specific name in the episode.
In the event of an unsuccessful player outcome in the board game Star Trek: The Next Generation - A Klingon Challenge, it is revealed that the ship entered a time loop prior to the adventure, thus giving players another chance to retake the ship.
The temporal causality loop was called a "pocket universe" in the book jacket of the novel Ship of the Line.