The longest story based game I've played was definitely BG2, which is a good 220 or so hours if you do everything.
As for open ended, sandbox style games... Is there even any point in mentioning them? I can't even imagine how much time I've spent with games like the Civilization series (played since Civ 1 first came out on Amiga in '92 through to Civ 4 today), Europa Universalis, Master of Orion, X-Com, Championship/Football Manager, Elite, Mordor, Daggerfall, Falcon 4.0 and other flight sims. Some of those are games I still keep installed many years on.
Not to mention the probable thousands of hours playing multiplayer Doom, Duke3D, Quake and UT back in the day.