The Messenger of Allah ﷺ forbade praying after the dawn prayer until sunrise, and after the afternoon prayer until sunset.
أخبرنا مجاهد بن موسى قال حدثنا ابن عيينة عن ضمرة بن سعيد سمع
نهى رسول الله ﷺ عن الصلاة بعد الصبح حتى الطلوع وعن الصلاة بعد العصر حتى الغروب
[Its chain is sahih] Ahmad narrated it, 3/6,7, from Sufyan bin Uyayna, with this chain, and it is in Kubra, hadith no. 1549. Ibn Uyayna explicitly stated that he heard it directly (Humaydi: 731), and the hadith has many corroborating narrations.