Caffeine can disrupt your sleep — even when consumed 12 hours before bed. While a 100 mg dose of caffeine (1 cup of coffee) can be consumed up to 4 hours before bedtime without significant effects on sleep, a 400 mg dose (4 cups of coffee) disrupts sleep when taken up to 12 hours before bedtime.