Abu Huraira is reported to have said that the Messenger of Allah (ﷺ) prohibited to observe prayer after the 'Asr prayer till the sun is set, and after the dawn till the sun rises.
The Book of Prayer - Travellers
Sahih Muslim 825 - Commentary by Imam An-Nawawi
Textual Analysis
This hadith from Abu Huraira (may Allah be pleased with him) establishes two prohibited times for voluntary prayer: after the Asr prayer until sunset, and after the Fajr prayer until sunrise.
Juridical Ruling
The prohibition applies to all supererogatory prayers without valid excuse. However, scholars exempt missed obligatory prayers, funeral prayers, and prostrations of recitation during these times.
Wisdom Behind the Prohibition
These times coincide with the sun's rising and setting, moments when polytheists would worship the sun. The prohibition distinguishes Muslim practice from pagan rituals.
Additionally, these are transitional periods between night and day, and the Shari'ah encourages rest and preparation for obligatory prayers during such intervals.
Scope of Prohibition
The ban applies even if one has a valid reason for missing the original prayer time. The wisdom preserves the distinction between times designated for worship and those reserved for other activities.