A ceasefire agreement has been reached between Israel and Hamas, more than 15 months into the conflict.