The 22nd Amendment, ratified in 1951, created term limits for the president. The longest a person can serve is 10 years, by serving for two years to fill the vacancy of the previous president, and then being elected president twice.
Source: Annenberg Classroom