I believe that before the show is shot, the cast signed a five-year contract, and if the show managed to stay on for five years, they renew their contract every year thereafter (provided the show is still on the air).
I don't know if it is Roddenberry's idea. After all, during the mid-series run of TNG he was replaced by Berman, who ultimately succeeded Roddenberry as the head of the franchise. But it was TNG that began the tradition of running no more than seven seasons (while you're at the top of the game).
------------------
Anyhoo, just some random thoughts...