Short answer
It is sunnah to stay for a while after the grave is filled and ask Allah to forgive the person and keep them firm, because they are being questioned. Hanafi books recommend staying about as long as it takes to slaughter a camel and share its meat, reciting Quran and making dua.
Standing at the grave after burial to make dua and seek firmness for the deceased is sunnah. Staying for about the time it takes to slaughter a camel and divide its meat, reciting Quran, is mustahabb; Hanafi texts mention reciting the opening of al-Baqarah at the head and its ending at the feet, from a report of Ibn Umar.
The four schools agree on this.
Explanation
The moments after burial are the hardest for the dead person and for the family. The Prophet ﷺ would stand at the grave once the burial was done and say: "Ask forgiveness for your brother and ask that he be made firm, for he is now being questioned." This is the sunnah, and the four schools agree it is recommended.
How long. As he was dying, Amr ibn al-As asked his family to stay around his grave after burying him for about as long as it takes to slaughter a camel and divide its meat, so he could feel their company while he answered the angels. Hanafi books take this as a recommended length. There is no fixed time; stay as long as you can sincerely make dua.
What to say and do:
- Allahumma-ghfir lahu wa thabbit-hu: "O Allah, forgive him and make him firm." Use her for a woman.
- Ask Allah to make the answers easy for them: their Lord is Allah, their religion is Islam, their prophet is Muhammad ﷺ.
- Recite some Quran. Hanafi books mention the opening verses of al-Baqarah at the head and its last verses at the feet.
- Each person may raise their hands and make dua quietly.
Talqin at the grave after burial, addressing the dead person with the answers, is not part of the relied-upon Hanafi practice, though it is not forbidden if someone does it, and some Shafi'is recommend it; see talqin for the dying. For the questions themselves, see the questions in the grave.
The evidence
Quran, Surah Ibrahim 14:27
يُثَبِّتُ ٱللَّهُ ٱلَّذِينَ ءَامَنُوا۟ بِٱلْقَوْلِ ٱلثَّابِتِ فِى ٱلْحَيَوٰةِ ٱلدُّنْيَا وَفِى ٱلْءَاخِرَةِ ۖ وَيُضِلُّ ٱللَّهُ ٱلظَّٰلِمِينَ ۚ وَيَفْعَلُ ٱللَّهُ مَا يَشَآءُ ﴿٢٧﴾
Allah keeps firm those who believe, with the firm word, in worldly life and in the Hereafter. And Allah sends astray the wrongdoers. And Allah does what He wills.
The dua at the grave asks for this firmness.
Sunan Abi Dawud 3221
Graded sahih... استغفروا لأخيكم وسلوا له التثبيت فإنه الآن يسأل ...
"Ask forgiveness for your brother and ask that he be made firm, for he is now being questioned."
Standing at the grave to make dua after burial is sunnah.
Sahih Muslim 121
Sahih... أقيموا حول قبري قدر ما تنحر جزور ...
"Stay around my grave for as long as it takes to slaughter a camel and divide its meat."
Amr ibn al-As's request, which Hanafi books take as the recommended length.
Where the ruling is recorded
- Radd al-Muhtar (Ibn Abidin), Kitab al-Salah, Bab Salat al-Janazah, after burial. Staying at the grave, reciting Quran and making dua; the report of Ibn Umar on al-Baqarah.
- al-Fatawa al-Hindiyya, Kitab al-Salah, chapter on the jana'iz, section on burial. Recommended to stay after burial for the time of slaughtering a camel.
Checked by our team. For a more accurate answer to your own situation, consult a scholar. Quran translation by Sahih International. Hadith Arabic from the standard editions of the six books and the Muwatta, with gradings as recorded there; the English is our own rendering. Spotted a mistake? Tell us.