'Abdullah bin 'Umar (May Allah be pleased with them) reported:
Messenger of Allah (ﷺ) said, "It is the duty of a Muslim who has something which is to be given as a bequest not to have it for two nights without executing a written will."[Al-Bukhari and Muslim].In the narration of Muslim it is narrated as 'three nights'. Ibn 'Umar (May Allah be pleased with them) said: Since I heard the Messenger of Allah say this, I have never spent a night without having my will with me.
Arabic/English book reference: Book 1, Hadith 575