It was narrated from 'Aishah that the Prophet (ﷺ) said:
"Whoever catches up with a Rak'ah of Fajr before the sun rises, then he has caught up with it; and whoever catches up with a Rak'ah of 'Asr before the sun sets, then he has caught up with it."
English reference: Vol. 1, Book 6, Hadith 552
Arabic reference: Book 6, Hadith 556
Read hadith from the major collections in the app, with prayer times and a Qibla compass. Free.