Either they get elected to the presidency, after the current president's term in office is up (George H.W. Bush was elected after Ronald Reagan), they take over after the death of the president...
The vice president becomes president if the current president dies or resigns. For example, John F. Kennedy was assassinated while Lyndon B. Johnson was vice presidend, so Johnson became president.