I'm assuming you're speaking of the Play Time stat shown on your profile...
p/5028582peppy wrote:
Counts total seconds actually spent playing a map (including breaks). Calculated retroactively, factoring in retries, exits and passes to roughly 95% accuracy.
I don't think the exact way it's calculated has been posted anywhere, but it's representing your time spent playing a beatmap. If I'm not mistaken it's based off all plays that you have submitted (including if you quit the song part way through, as that also submits data to the servers), which means that being AFK or on the pause menu or whatever else that isn't playing a beatmap doesn't count towards it at all.