Praise be to Allah.
It is Sunnah for the one who places the deceased in the grave to say: “BismIllah wa ‘ala sunnati Rasool-Illah (or: wa ‘ala millati Rasool-Illah) sall-Allahu ‘alayhi wa sallam (In the name of Allah and according to the Sunnah of the Messenger of Allah (or: according to the religion of the Messenger of Allah (peace and blessings of Allah be upon him)).
This is narrated in the hadeeth of Ibn ‘Umar (may Allah be pleased with him) who said that when the Prophet (peace and blessings of Allah be upon him) placed the deceased in the grave he would say (and according to another version, he said: When you place your dead in the graves say:) “BismIllah wa ‘ala sunnati Rasool-Illah”; according to another report: “wa ‘ala millati Rasool-Illah.”
This was narrated by Abu Dawood, 3213; al-Tirmidhi, 1046; Ibn Maajah, 1550; al-Haakim, 1353; classed as saheeh by al-Albani in Ahkaam al-Janaa’iz, p. 192.
After completion of the burial it is Sunnah to pray for forgiveness for the deceased and pray for him to be made steadfast, because of the hadeeth of ‘Uthmaan ibn ‘Affaan (may Allah be pleased with him) who said: When the Prophet (peace and blessings of Allah be upon him) had finished burying the deceased he would stand over him and say: “Pray for forgiveness for your brother, and ask that he be made steadfast, for now he is being questioned.”
Narrated by Abu Dawood, 3221; classed as saheeh by al-Albani in Ahkam al-Janaa’iz, p. 198.
Standing over him means standing over his grave.
“and [said]: Pray for forgiveness for your brother” means: ask for forgiveness for him from Allah, i.e., say: “O Allah forgive him.”
“and ask that he be made steadfast” means: ask Allah to make his tongue steadfast in answering the two angels, i.e., say: “O Allah make him steadfast in speech.”
“for now he is being questioned” i.e., at that moment the two angels are coming to him, namely Munkar and Nakeer, so he is in the greatest need of prayers for forgiveness and steadfastness.