A vice president who assumes the office of president to finish out a term may serve a maximum of 10 years. If there are two years or less remaining in the term of the president who left office, the vice president may run for two additional terms. If more than two years remaining, the vice-president may run for only one additional term.
22nd amendment:
However, it is possible for an individual to serve up to ten years as president. The amendment specifies that if a vice president or other successor takes over for a president—who, for whatever reason, cannot fulfill the term—and serves two years or less of the former president’s term, the new president may serve for two full four-year terms.