Answer
In the Name of Allah, Most Gracious, Most Merciful.
All praise and thanks are due to Allah, and peace and blessings be upon His Messenger.
In this fatwa:
If the Muslim has an excuse, such as sleeping or forgetting, and he was not able to do the prayer on time, then he must make up the prayer when that reason no longer applies, even if that is at one of the times when prayer is disallowed. This is the view of the majority of scholars.
In his response to your question, Sheikh Muhammad Salih Al-Munajjid, a prominent Saudi Muslim lecturer and author, states:
There are some times at which the Prophet (peace be upon him) disallowed prayer. These are:
1 – From after Fajr prayer until the sun has appeared and risen to the height of a spear, i.e., approximately fifteen minutes. (Al-Sharh al-Mumti`, 4/162)
2 – The time when the sun is at its zenith in the middle of the sky. This is a short time before the time for Zhuhr prayer begins, approximately one-quarter of an hour or twenty minutes. (Fatawa Al-Shaykh Ibn Baz, 11/286)
Some of the scholars said that it was shorter than that. Ibn Qasim (may Allah have mercy on him) said that it is a brief time period, not even long enough to pray, only enough to say the takbir to start the prayer. (Hashiyat Ibn Qasim `ala’ al-Rawd al-Murabba’, 2/245)
3 – After Asr prayer until the sun sets.
These three times were mentioned in many hadiths in which the Prophet (peace be upon him) forbade praying at these times. These hadiths include the following:
1 – Al-Bukhari and Muslim narrated that Abu Sa`id al-Khudri (may Allah be pleased with him) said: “The Messenger of Allah (peace be upon him) said: ‘There is no prayer after Asr prayer until the sun has set, and no prayer after Fajr prayer until the sun has risen.’”
2 – Muslim narrated that `Amr ibn ‘Abasah al-Sulami (may Allah be pleased with him) said: “I said, ‘O Prophet of Allah, tell me what Allah has taught you and I do not know, tell me about the prayer.’ The Messenger of Allah (peace be upon him) said: ‘Pray Fajr prayer, then do not pray until the sun has appeared and risen… then pray for your prayer is witnessed and attended (by the angels), until the shadow of a spear points due north – which is the time when the sun is in the middle of the sky – then stop praying, for at that time Hell is stoked up. When the shadow turns – which is the beginning of the time for Zhuhr – then pray, for your prayer is witnessed and attended (by the angels), until you pray Asr. Then stop praying until the sun sets…”
What is meant by making up prayers is doing the prayer after the time for that prayer is over. The made-up prayer may be either obligatory or supererogatory.
Obligatory prayers: The Muslims must pray regularly at the times defined by Allah for each prayer. Allah says:
“Verily, the prayer is enjoined on the believers at fixed hours.” (An-Nisa’ 4:103)
Delaying the prayer until its time is over without a reason or excuse is forbidden, and it is a major sin.
If the Muslim has an excuse, such as sleeping or forgetting, and he was not able to do the prayer on time, then he must make up the prayer when that reason no longer applies, even if that is at one of the times when prayer is disallowed. This is the view of the majority of scholars. (Al-Mughni, 2/515)
The evidence for that is the words of the Prophet (peace be upon him): “Whoever sleeps and misses the prayer or forgets it, let him pray it when he remembers.” (Al-Bukhari and Muslim)
Supererogatory prayers: the scholars differed with regard to making them up at times when prayer is disallowed. The correct view is that they should be made up. This is the view of Al-Shafa’i (may Allah have mercy on him). (Al-Majmu`, 4/170)
It was also the view favoured by Ibn Taymiyyah (may Allah have mercy on him), as stated in Al-Fatawa, 23/127. This is indicated by a number of hadiths, such as:
The report narrated by Al-Bukhari and Muslim from Umm Salamah (may Allah be pleased with her), that the Prophet (peace be upon him) prayed two rak`ahs after Asr, and she asked him about that. He said: “Some people from ‘Abd al-Qays came to me and distracted me from praying two rak`ahs after Zhuhr, so I did them now.”
Ibn Majah narrated that Qays ibn ‘Amr said: the Prophet (peace be upon him) saw a man praying two rak`ahs after he had prayed Fajr prayer. The Prophet (peace be upon him) said, “Are you praying Fajr twice?” The man said to him, “I did not pray the two rak`ahs that come before it, so I prayed them now.” The Prophet (peace be upon him) remained silent. This was classed as sahih by Al-Albani in Sahih Ibn Majah.
Ibn Qudamah (may Allah have mercy on him) said: the fact that the Prophet (peace be upon him) remained silent indicates that it is permissible. (Al-Mughni, 2/532)
Almighty Allah knows best.
Source: https://islamqa.info/en/20013