If I drink tea, then go to sleep for a while, when I wake up, will the effect of tea still be on me (the refreshing effect)?
Does it depend on the duration of sleep?
Caffeine is the stimulant in tea. It has different effects on different people, but if you can sleep right after drinking it, it probably isn't strong enough to have long term 'refreshing effects', And yes, the duration of your sleep does matter. If you sleep for 12 hours, much more caffeine will filter out of your blood stream than after a 1 hour nap.
Some info on how caffeine works, from here:
Caffeine, a component of tea, coffee and cola, induces wakefulness. It binds to adenosine A1 and A2A receptors as an antagonist, but the receptor subtype mediating caffeine-induced wakefulness remains unclear. Here we report that caffeine at 5, 10 and 15 mg kg-1 increased wakefulness in both wild-type mice and A1 receptor knockout mice, but not in A2A receptor knockout mice. Thus, caffeine-induced wakefulness depends on adenosine A2A receptors.