The times when (voluntary or naafil) prayer is not allowed are basically three, and five ‘when explained in detail. They are:
·From dawn until sunrise
·From sunrise until the sun has risen to the height of a spear, which is approximately as twelve minutes, but to be on the safe side we make it a quarter of an hour.
·When the sun is high at noon, until it passes the zenith.
·From ‘Asr prayer until sunset.
·When the sun begins to set until it is fully set.
In brief, the times are:
·From dawn until the sun has risen to the height of a spear
·When high at noon, until it has passed the zenith
·From ‘Asr prayer until the sun has fully set.
For the evidence on that please see the answer to question no. 48998
During these times, voluntary prayer is not allowed. With regard to offering obligatory prayers or making them up, the prohibition has nothing to do with that.
The basic principle is that voluntary prayers are prescribed at all times, because of the general meaning of the verse in which Allah, may He be exalted, says (interpretation of the meaning):
“O you who believe! Bow down, and prostrate yourselves, and worship your Lord and do good that you may be successful”
And the general meaning of the words of the Prophet (blessings and peace of Allah be upon him) to the man who had done a favour for him. The Prophet (blessings and peace of Allah be upon him) said: “Ask.” He said: I ask to be in your company in Paradise. The Prophet (blessings and peace of Allah be upon him) said: “Is there anything else?” He said: That’s it (i.e., I do not ask you for anything else). He said: “Then help me to help you by prostrating a great deal.” Based on that, the general principle concerning voluntary prayer is that it is prescribed at all times, for the one who is at home and the one who is travelling, but there are some times during which the Lawgiver has disallowed prayer, and these times are five…
End quote from ash-Sharh al-Mumti‘ by Shaykh Ibn ‘Uthaymeen (may Allah have mercy on him).
A number of fuqaha’ made exceptions for some types of naafil prayer at times when prayer is not allowed. They are:
The two rak‘ahs following tawaaf (circumambulation of the Ka‘bah). That is because of the report narrated by at-Tirmidhi (868), an-Nasaa’i (2924), Abu Dawood (1894), and Ibn Maajah (1254) from Jubayr ibn Mut‘im, according to which the Prophet (blessings and peace of Allah be upon him) said: “O Bani ‘Abd Manaaf, do not prevent anyone from circumambulating this House or praying at any time he wants of the day or night.”. The hadeeth was classed as saheeh by al-Albaani in Saheeh at-Tirmidhi.
Repeating a prayer in congregation. If a person has offered the obligatory prayer, then he comes to a mosque and finds the congregation praying, he may pray with them, even if that is at a time when prayer is disallowed, and his prayer with them will be naafil. That is because of the report narrated by at-Tirmidhi (219) and an-Nasaa’i (858) from Yazeed ibn al-Aswad al-‘Aamiri who said: I was present with the Prophet (blessings and peace of Allah be upon him) during his Hajj, and I prayed Fajr with him in the mosque of al-Khayf. Then when he had finished his prayer and left, he saw two men at the back of the people who had not prayed with him. He said: “Bring them to me.” They were brought, trembling, and he said: “What kept you from praying with us?” They said: O Messenger of Allah, we had already prayed in our camp. He said: “Do not do that. If you have prayed in your camp and you come to the mosque of a congregation, pray with them, and it will be naafil for you.”
The hadeeth was classed as saheeh by al-Albaani in Saheeh at-Tirmidhi.
The Sunnah following Zuhr prayer if one is putting Zuhr together with ‘Asr – it is permissible to do it after ‘Asr. The Prophet (blessings and peace of Allah be upon him) was distracted and did not offer the Sunnah prayer after Zuhr, so he prayed it after ‘Asr. It was narrated by al-Bukhaari (1233) and Muslim (834) that the Prophet (blessings and peace of Allah be upon him) said to Umm Salamah: “O daughter of Abu Umayyah, you asked about the two rak‘ahs after ‘Asr. Some people from Banu ‘Abd al-Qays came to me, and they distracted me from praying the two rak‘ahs that come after Zuhr; these are they (i.e., I prayed them now).”
One who comes in on Friday when the imam is delivering the khutbah; he may pray two brief rak‘ahs, even if that is at the time when the sun is high. That is because of the report narrated by al-Bukhaari (931) and Muslim (875) from Jaabir, who said: A man came in on Friday when the Prophet (blessings and peace of Allah be upon him) was delivering the khutbah. He said: “Have you prayed?” He said: No. He said: “Get up and pray two rak‘ahs.”
The funeral prayer may be offered during the lengthy times when prayer is not allowed, according to scholarly consensus, i.e., after Fajr prayer until the sun rises and after ‘Asr prayer until the sun sets.
Ibn Qudaamah (may Allah have mercy on him) said: The funeral prayer may be offered. With regard to offering the funeral prayer after Fajr prayer until the sun rises and after ‘Asr until the sun sets, there is no difference of scholarly opinion concerning it. Ibn al-Mundhir said: The consensus of the Muslims is that the funeral prayer may be offered after ‘Asr and Fajr.
With regard to offering the funeral prayer at the three times mentioned in the hadeeth of ‘Uqbah ibn ‘Aamir, that is not permissible. This was mentioned by al-Qaadi and others. Al-Athram said: I asked Abu ‘Abdullah about offering the funeral prayer when the sun has just risen. He said: As for (doing so) when the sun has just risen, I do not like that. Then he quoted the hadeeth of ‘Uqbah ibn ‘Aamir.
A similar opinion was narrated from Jaabir and Ibn ‘Umar. This was quoted by Maalik in al-Muwatta’ from Ibn ‘Umar. And al-Khattaabi said: This is the view of the majority of scholars.
Abu’l-Khattaab said, narrating a different report from Ahmad, that offering the funeral prayer is permissible at all times when prayer is disallowed. And this is the view of ash-Shaafa‘i, because it is a prayer that is permitted after Fajr and ‘Asr, so it is permitted at all times, like the obligatory prayers.
But ‘Uqbah ibn ‘Aamir said: There are three times at which the Messenger of Allah (sa) forbade us to pray or to bury our dead. The fact that he mentioned the prayer along with burial indicates that what is meant is the funeral prayer, because it is a prayer other than the five obligatory prayers, so it is not permissible to do it at these three times, as is the case with all naafil prayers in general. Rather it is permitted after Fajr and ‘Asr because these periods may be lengthy and waiting may not be convenient, but these three other periods are brief. With regard to the obligatory prayers, they cannot be taken as an analogy, because they have to be done, and it is not valid to draw an analogy between these three times and the other two times, because the prohibition in this case (the three times) is clearer and they are shorter, so there is no fear for the deceased in this case. Moreover, it is forbidden to bury the deceased at this time, and when the prayer is mentioned in conjunction with the burial, this signifies that what is meant is the funeral prayer, unlike the other two times.
End quote from al-Mughni, 1/425
The wording of the hadeeth of ‘Uqbah ibn ‘Aamir (may Allah be pleased with him) is: There are three times when the Messenger of Allaah (blessings and peace of Allah be upon him) told us not to pray or bury our dead: when the sun begins to rise until it is high, when it is standing directly overhead at noon, and when it has started to set, until it has set.. Narrated by Muslim, 831
The fuqaha’ differed concerning some of the naafil prayers and whether it is prescribed to do them at a time when prayer is not allowed or not. One of their differences has to do with naafil prayers that done for a reason, such as “greeting the mosque” (tahiyyat al-masjid) and the Sunnah prayer following wudoo’. Some of them said that it is permissible to do them at times when prayer is not allowed; this is the view of ash-Shaafa‘i (may Allah have mercy on him), and was favoured by a number of the scholars, and it is the more correct view. And some of the scholars disallowed that and did not differentiate between general naafil prayers and naafil prayers that are done for a specific reason. See the answer to question no. 306
And Allah knows best.