Steam tells you but I'm not sure there's any way of getting more detail unless the game itself offers that sort of tracking. I know Forza 3 (Xbox 360) tells you specifically how much time you've spent in various areas - in menus, driving, tuning, painting, in the auction house, etc. Most games that track your playing time still count it even if you're paused in a menu for an hour while you do something else.
I never understood how people could estimate how long games were. I couldn't tell you the difference between a 6-hour game and a 10-hour game. Figured those were always complete wild guesses; there's no way to keep an accurate record without manually doing it yourself and writing it down, which I'm sure almost no one does.