Why did Jimmy Carter's presidency end in 1982?

Jimmy Carter's presidency ended because he lost the election to George H.W. Bush.