The only way to accurately assume how long a game will take other than looking up reviews and specifically searching for estimated completion times would be to have first hand experience with the game (if part of a series). There's no easy way to look at a game and immediately assume it will take X hours unless you have a lot of experience gaming.
Needless to say, RPGs are the longest to complete, typically ranging between 20 and 40+ hours (with Bethesda RPGs assume longer).
First person shooters are more varied, with some lasting around an hour (Rogue Warrior) but most lasting between 5-10 hours for the single player campaigns alone (Call of Duty, Battlefield, Bioshock, etc). Assume online multiplayer can consume 100's of hours if you're dedicated.
I'd go into more detail/depth but honestly it's a combination of the game, the competency of the player, the gaming experience of the player, and the style of gameplay (achievement hunter, casual, speed run, etc).