The headline finding across exercise-and-sleep research is reassuring: moderate aerobic exercise reliably improves how fast you fall asleep, how much you wake during the night, and overall sleep efficiency — largely independent of what time of day you train.
Where timing becomes relevant is at the high-intensity, close-to-bedtime end of the spectrum. A study tracking nearly 15,000 adults found that exercising within four hours of bedtime was associated with delayed sleep onset and reduced total sleep time by up to 43 minutes.
None of this means evening exercise is off-limits — for many people, training three to eight hours before bed actually shows some of the strongest sleep-quality benefits in the research.
Further reading: Dose-response relationship between evening exercise and sleep (Nature Communications).