It is prescribed for you, when death approaches any of you, if he leaves wealth, that he make a bequest to parents and next of kin, according to reasonable manners. (This is) a duty upon Al-Muttaqun. (Surat Al Baqarah: 2-180)
Narrated Abdullah bin Umar: Allah's Apostle said, "It is not permissible for any Muslim who has something to will to stay for two nights without having his last will and testament written and kept ready with him." (Sahih Bukhari: Volume 4, Book 51)