The Prophet ﷺ forbade praying after the afternoon prayer until the sun sets, and praying after the dawn prayer until the sun rises.
أخبرنا قتيبة عن مالك عن محمد بن يحيى بن حبان عن الأعرج
أن النبي ﷺ نهى عن الصلاة بعد العصر حتى تغرب الشمس وعن الصلاة بعد الصبح حتى تطلع الشمس
Muslim narrated it, no: 825. See the previous hadith from Malik's narration, and it is in Muwatta (Yahya): 1/221, and Kubra, no: 1545.