Caution: Translations of Quran and Ḥadīth may lead to possible misapplications and misinterpretations. This site is intended for students of sacred knowledge that are proficient in comprehending classical Arabic and have a strong foundation in Islamic sciences. Also note that religious injunctions rely on several aspects beyond what one may glean through reading individual aḥādīth.
quran:2:180

Prescribed for you when death approaches ˹any˺ one of you if he leaves wealth ˹is that he should make˺ a bequest for the parents and near relatives according to what is acceptable - a duty upon the righteous.  

Prescribed, made obligatory, for you, when any of you is approached by death, that is, ˹by˺ its causes, and leaves behind some good, material possessions, is to make testament (al-wasiyyatu is in the nominative because of kutiba, and is semantically connected to the particle idhā, ‘when’, if the latter is adverbial; but if this latter is conditional, then it ˹al-wasiyyatu˺ indicates the response; the response to the ˹conditional˺ particle in, ‘if’, is, in other words, ˹implied to be˺ fa’l-yūsi, ‘let him make testament’); in favour of his parents and kinsmen honourably, that is justly, not giving more than the allotted share of a third, nor preferring the richer person — an obligation (haqqan here emphasises the import of what has preceded) on those that fear, God (this verse has been abrogated by the ‘inheritance’ verse ˹āyat al-mīrāth, see Q. 4:11˺ and by the hadīth: ‘Do not make testament for one ˹already˺ inheriting’, as reported by al-Tirmidhī).
القرآن:٢:١٨٠

كُتِبَ عَلَيْكُمْ إِذَا حَضَرَ أَحَدَكُمُ الْمَوْتُ إِنْ تَرَكَ خَيْرًا الْوَصِيَّةُ لِلْوَالِدَيْنِ وَالْأَقْرَبِينَ بِالْمَعْرُوفِ ۖ حَقًّا عَلَى الْمُتَّقِينَ  

{كتب} فرض {عليكم إذا حضر أحدكم الموت} أي أسبابه {إن ترك خيرا} مالا {الوصية} مرفوع بكتب ومتعلق بإذا إن كانت ظرفية ودال على جوابها إن كانت شرطية وجواب إن أي فليوص {للوالدين والأقربين بالمعروف} بالعدل بأن لا يزيد على الثلث ولا يفضل الغني {حقا} مصدر مؤكد لمضمون الجملة قبله {على المتقين} الله وهذا منسوخ بآية الميراث وبحديث: (لا وصية لوارث رواه الترمذي).

See similar narrations below:

Collected by Dārimī
darimi:3225Yazīd > Hammām

[Machine] "About Qatadah, it is written that when death approaches you, it is obligatory upon the God-conscious individuals to leave a will for their parents and close relatives, according to the custom of good deeds. This is a right upon the righteous individuals." [Surah Al-Baqarah, verse 180]. The phrase "Al-khayr (the good) referred to wealth of one thousand or more (dirhams) and beyond."  

الدارمي:٣٢٢٥أَخْبَرَنَا يَزِيدُ أَنْبَأَنَا هَمَّامٌ

عَنْ قَتَادَةَ {كُتِبَ عَلَيْكُمْ إِذَا حَضَرَ أَحَدَكُمُ الْمَوْتُ إِن تَرَكَ خَيْرًا الْوَصِيَّةُ لِلْوَالِدَيْنِ وَالْأَقْرَبِينَ بِالْمَعْرُوفِ حَقًّا عَلَى الْمُتَّقِينَ} [البقرة 180] قَالَ الْخَيْرُ الْمَالُ كَانَ يُقَالُ أَلْفًا فَمَا فَوْقَ ذَلِكَ