Abu Huraira reported: The Messenger of Allah, peace and blessings be upon him, prohibited us from performing two prayers: a prayer after dawn prayer until the sun has risen, and a prayer after afternoon prayer until the sun has set.
Source: Ṣaḥīḥ al-Bukhārī 588
Grade: Sahih (authentic) according to Al-Bukhari
Ibn al-Qayyim said, “Prohibiting prayer after the afternoon and dawn prayers is blocking the means because of the connection of these two times to those idolaters who prostrate to the sun.”
Source: al-Jawāb al-Kāfī 1/134
عَنْ أَبِي هُرَيْرَةَ قَالَ نَهَى رَسُولُ اللَّهِ صَلَّى اللَّهُ عَلَيْهِ وَسَلَّمَ عَنْ صَلَاتَيْنِ بَعْدَ الْفَجْرِ حَتَّى تَطْلُعَ الشَّمْسُ وَبَعْدَ الْعَصْرِ حَتَّى تَغْرُبَ الشَّمْسُ
588 صحيح البخاري كتاب مواقيت الصلاة
قال ابن القيم وَسَدَّ الذَّرِيعَةَ بِأَنْ مَنَعَ الصَّلَاةَ بَعْدَ الْعَصْرِ وَالصُّبْحِ لِاتِّصَالِ هَذَيْنِ الْوَقْتَيْنِ بِالْوَقْتَيْنِ اللَّذَيْنِ يَسْجُدُ الْمُشْرِكُونَ فِيهِمَا لِلشَّمْسِ
1/134 الجواب الكافي