Studies show that some individuals may feel the effects of coffee up to 8 hours after consumption. This means your afternoon coffee could cause you to feel active and alert well past your bedtime. Therefore, it is best to avoid caffeinated beverages after 2 p.m. This stretch of time allows your body to metabolize caffeine and keep it from disrupting your sleep.