It was narrated from Abu Hurairah that the Prophet (ﷺ) said:
"Whoever catches up with a prostration of Subh before the sun rises, then he has caught up with it; and whoever catches up with a prostration of 'Asr before the sun sets, then he has caught up with it." (AR)
English reference (AR): Vol. 1, Book 6, Hadith 551 (AR)
Arabic reference (AR): Book 6, Hadith 555 (AR)