Begging Allah's Pardon is praiseworthy at certain times and situations, though the gateways of repentance are open all the time, as the Honest Prophet (May Allah exalt his mention, and peace be upon him) said: "Surely, there is an open gateway of repentance which will not be shut until the sun rises from the West."
But, there are certain times and situations which are better for begging Allah's Pardon as the response is commonly expected during them such as:
1- The last hours of the night: Allah, the Exalted, said:
“… and those who pray and beg Allah's Pardon in the last hours of the night.” (Surah Aal-‘Imran: 17)
And, Allah, the Exalted, said:
“And in the hours before dawn, they were (found) asking (Allah) for forgiveness.” (Surah Adh-Dhariyat: 18)
And the Prophet (May Allah exalt his mention, and peace be upon him) said:
"Our Lord, the Blessed, the Superior, comes every night down on the nearest Heaven to us when the last third of the night remains, saying: "Is there anyone to invoke Me, so that I may respond to invocation? Is there anyone to ask Me, so that I may grant him his request? Is there anyone seeking My forgiveness, so that I may forgive him.”
2- During and after prayers: such as the opening supplication between declaring Allah's Greatness by saying: "Allah's Greater" and reciting (Surat Al-Fatihah) such as:
“O Allah! Set me apart from my sins (faults) as the East and West are set apart from each other and clean me from the sins as a white garment is cleaned of dirt (after thorough washing). O Allah! Wash off my sins with water, snow and hail.”
- And one of the opening supplications which include asking Allah for forgiveness was narrated by Muslim who reported that Ali (May Allah be pleased with him) reported that whenever the Messenger of Allah (May Allah exalt his mention, and peace be upon him) started his prayers, he would say:
“I have turned my face to Him, Who created the heavens and the earth, upright and I am not of the idolaters. Surely, my prayers, my sacrifice, my living, and my dying are for Allah, the Lord of the worlds. He has no partner. And I have been commanded to do that, and I am the first Muslim. O Allah! You are the Owner. There is no true god but You. You are my Lord, and I am Your servant, I have wronged myself, and I acknowledge my sin, so, forgive me all my sins for none forgives the sins except You, and guide me to the best morals, for none guides to the best of them except You, and turn me away from the bad morals, for none turns me away from them but You. Here I am responding to You, and at Your pleasure, and all goodness is in Your hands and the evil is not ascribed to You. I seek refuge in You, and You guide me. Blessed and Exalted are You, I ask You for forgiveness and I repent to You” …Then, he used to say towards the end of his prayer between “Tashahhud” and the concluding salutations: "(O Allah! Forgive my former and latter sins, which I have done secretly and those which I have done openly, and that I have wronged others, and those defaults of mine about which You have better knowledge than I have. You Alone can send whomever You will to Paradise, and You Alone can send whomever You will to Hell-fire. None has the right to be worshipped but You.”
And in another narration of “Muslim”: He used to say after the concluding salutations, not between “Tashahhud” and the concluding salutations: “O Allah! Forgive my former and latter sins …..”
- And the Prophet (May Allah exalt his mention, and peace be upon him) used to recite in his bowing:
"O Allah! You are free from imperfection and I begin with praising You. Forgive my sins.”
- And while prostrating, the Prophet (May Allah exalt his mention, and peace be upon him) said:
"A slave becomes nearest to his Lord when he is in prostration. So increase supplications while prostrating.”
And the Prophet (May Allah exalt his mention, and peace be upon him) used to recite in his prostrating:
“O Allah! Forgive all my sins, the small and the great, the first and the last, the open and the secret.”
- And between the two prostrations, the Prophet (May Allah exalt his mention, and peace be upon him) used to say:
“O my Lord! Forgive me. O my Lord! Forgive me.”
Abu Bakr (May Allah be pleased with him) said to the Prophet (May Allah exalt his mention, and peace be upon him) “Teach me an invocation so that I may invoke Allah with it in my prayer.” He said:
“Say: O Allah! I have done great injustice to myself and none except You forgives sins, so please forgive me and be Merciful to me as You are the Forgiver, the Merciful.”
Some scholars said that it should be recited after “Tashahhud”.
And in “Sahih Muslim”, Thauban (May Allah be pleased with him) reported: Whenever the Messenger of Allah (May Allah exalt his mention, and peace be upon him) finished his prayer, he would beg forgiveness three times, and then he would say:
"O Allah! You are the Bestower of security and security comes from You; Blessed are You. O Possessor of glory and honour!).''
Al-Walid said: I asked Al-Auza`i (one of the subnarrators of this Hadith): "How forgiveness should be sought?'' He replied: "Say: I seek Forgiveness from Allah. I seek Forgiveness from Allah.''
So, asking Allah for forgiveness accompanies the Muslim during his prayer from its beginning to its end. Nay, it accompanies him after the end of his prayer.
 HR. Bukhari, 11/128, Muslim, 2/36, dari hadits Abu Hurairah.
 Narrated by Al-Bukhari, 2/727, Muslim, 5/96, on the authority of Abu Hurairah.
 Narrated by Muslim, 6/76.
 Narrated by Al- Bukhari, 2/281, Muslim, 4/201, on the authority of Aishah.
 Narrated by Muslim, 4/200, on the authority of Abu Hurairah.
 Narrated by Muslim, 4/201, on the authority of Abu Hurairah.
 Narrated by Nasa'i, 2/232, Ahmad, 5/398, Ibn Majah, 898, on the authority of Hudhaifah.
 Narrated by Al - Bukhari, 2/317, Muslim, 17/28, on the authority of Abdullah bin Amr.
Please write: COMMENT in this box to verify that you are human