Yes. The Prophet (ṣallallāhu ʿalayhi wa sallam) said, "There is no prayer after the Fajr prayer until the sun rises, and no prayer after the ʿAṣr prayer until the sun sets," and ʿUqbah ibn ʿĀmir reported three times at which he forbade praying and burying the dead: when the sun begins to rise until it has lifted clear of the horizon, when it is at its zenith until it passes the meridian, and when it is sinking towards setting until it has set. Scholars agree these prohibitions concern general voluntary prayers, not obligatory ones: a missed farḍ is prayed as soon as it is remembered, as in the ḥadīth "Whoever forgets a prayer, let him pray it when he remembers it; there is no expiation for it except that." There is legitimate ikhtilāf over prayers that have a specific cause — greeting the mosque, the funeral prayer, the two rakʿahs after ṭawāf, the sunnah of wuḍūʾ — with the Shāfiʿīs and many verifying scholars permitting them at these times precisely because of their cause, while the Ḥanafīs and Ḥanbalīs restrict this more narrowly. What is agreed upon is that deliberately timing a voluntary prayer to coincide with sunrise or sunset is not allowed, because of the explicit prohibition.
Q&A · Prayer
Are there times when it is forbidden to pray?
Evidence — the daleel
Sahih Muslim 827 ṢaḥīḥSahih al-Bukhari 586 ṢaḥīḥSahih Muslim 831 ṢaḥīḥSahih al-Bukhari 597 ṢaḥīḥSahih Muslim 684 Ṣaḥīḥ
On deen2u
Informational, not a personal fatwa. Consult a qualified scholar for rulings on your situation.