(covers information from several alternate timelines)
A generational ship was a starship in which, over an extended period of time, the operations of the ship were passed down to successive generations of the crew's descendants. They were typically used by races who did not have access to warp drive technology for lengthy travel across space.
The "Sky Spirits", while apparently capable of warp travel, had to make use of a generational ship system in order to visit Earth from their home world in the Delta Quadrant, due to the sheer distances involved. It took more than two of their generations just to travel one way. The species would do this several times over thousands of years. (VOY: "Tattoo")
Yonada, a generational asteroid ship, was launched by the Fabrini around 8,000 BC to colonize a new planet after their homeworld was destroyed by a nova. The vessel spent ten thousand years in deep space, so long that the crew's descendants had forgotten that they were on a ship. (TOS: "For the World is Hollow and I Have Touched the Sky")
Around the 20th century, the Kelvan Empire – having discovered that rising radiation levels would render their native Andromeda Galaxy uninhabitable within ten thousand millennia – dispatched multi-generational starships to their neighboring galaxies, searching for new territories suitable for conquest and occupation. One such expedition arrived in the Milky Way Galaxy in 2268, where it encounter the USS Enterprise. (TOS: "By Any Other Name")
In an alternate timeline in which Enterprise NX-01 was thrown back in time 117 years from 2154, Enterprise became a generational ship, the crew showing their children how to operate and maintain ship's systems, a process which was repeated for the next generation. Eventually, the crew was able to change history by intercepting their counterparts in 2154, and assisting them in making modifications which prevented the time travel event from occurring. (ENT: "E²")
In 2371, shortly after the USS Voyager became stranded in the Delta Quadrant, Chakotay suggested that the crew would have to seriously consider procreation in order to man the starship long enough to make it back home, saying that they would need a replacement crew halfway through the seventy-five years it was projected the return trip would take. Kathryn Janeway marveled at the fact that their three week mission had morphed into one requiring a generational ship to complete. (VOY: "Elogium")
In 2375, the crew of Voyager encountered a Varro generational ship in the Delta Quadrant, which had been in continuous operation for four hundred years. Assisting the Varro crew in making repairs, they eventually uncovered an underground movement aboard the generational vessel aimed towards breaking away from the rest of the community and exploring the galaxy. (VOY: "The Disease")