I'm sure I've read what it specifically is before, but I can't quite remember. For me, though, I try to keep any caffeinated drinks before 7:00 in the evening. I can go a bit later than that without having [extra] trouble getting to sleep, but that's a safe distance for me.
So I'd guess around three hours? I'm sure that the half life is considerably longer, but that seems to be the length of the real effects for me.
Oh, also, if you're wanting some caffeine around 5-6, you might want to try yerba mate. It contains a good amount of caffeine, and also theobromine and theophylline, which seem to "calm" the caffeine a bit; less shaking of hands/potential anxiety, etc. On top of that, it contains magnesium, which seems to give it a bit more of a relaxing effect on the body (while still giving a nice, smoother caffeine buzz). From what I've heard (haven't tried it myself yet), a lot of people are able to drink it until pretty late at night without having a problem getting to sleep.