Science Says When to Stop Drinking Coffee to Ensure a Good Night’s Sleep. And It Is Earlier Than You Think. Posted byAmanda Breen July 15, 2021 Leave a comment on Science Says When to Stop Drinking Coffee to Ensure a Good Night’s Sleep. And It Is Earlier Than You Think. You might think that enjoying your last cup of joe in the late afternoon is enough to avoid adverse sleep effects, but science says otherwise.