You still fall asleep fine; you lose about 45 minutes of the night
Across 24 studies, falling asleep slipped by about 9 minutes while the night itself lost 45. The same data puts about 9 hours between a standard coffee and an undisturbed night.
What the study found
Coffee too late costs about 45 minutes of sleep that night
Falling asleep barely suffers: onset slipped by about 9 minutes across 24 studies. The night itself takes the loss, 45 minutes of it, with deep sleep cut and sleep efficiency down about 7%. The same pooled data puts about 9 hours between a standard cup of coffee and an undisturbed night.
The caveat · 9 hours is an average, not a cut-off
That 9-hour figure is an average across many doses and timings, not a personal cut-off. How fast a person clears caffeine varies widely, partly for genetic reasons, so the same cup at the same hour lands differently on two people. Older adults' sleep tends to be more sensitive to it than younger adults'.