It is narrated from Sayyiduna Ibn Umar (may Allah be pleased with them both) that the Messenger (peace and blessings be upon him) said: "It is not befitting for any person that three nights should pass without his will being written and kept with him." Sayyiduna Ibn Umar (may Allah be pleased with them both) says: "Since the day I heard this statement, there has not been a single night that has passed in which my will was not written and kept with me."
Hadith Referenceمسند احمد / مسند المكثرين من الصحابة / 4469