Israel and Hamas agreed to extend their cease-fire for two more days past Monday, the Qatari government said, bringing the prospect of a longer halt to their deadliest and most destructive war and further exchanges of militant-held hostages for Palestinians imprisoned by Israel.