If a vice president takes over the office of president , how many years can they stay in office

They can stay in office for the remainder of the original president's term, which is up to four years. After that, they may run for reelection and serve up to two terms in total.