(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 the crew's descendants. They were typically used by races who did not have access to warp drive technology for lengthy travel across space.
Around the 20th century, the Kelvan Empire – having discovered that rising radiation levels would render their native Andromeda Galaxy uninhabitable within 10,000 millenia – 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 400 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")