WASHINGTON—President Barack Obama told Afghanistan's leader, Hamid Karzai, that the U.S. was preparing for a full troop withdrawal by year's end, but opened the door to reaching an accord with Mr. Karzai's successor for soldiers to remain.

Tuesday's move effectively pushes back the timing of a final White House troop decision until later this year, following Afghan elections. Mr. Karzai, in refusing to sign the security accord, has...