I've run the gamut of game times from a half hour because character creation took too long and we just did a quick fight scene to say we played, all the way to a weekend long marathon game where we stopped for a few hours of rest and to grab food.
From my playing experience, and ideal game is roughly four hours long if we're staying system agnostic. If the game is more socially based, I've found that its much more preferable to keep it shorter because the DM may not have enough material to keep up with the party because social interactions tend to be the most malleable of situations and easily veer from the intended path. Conversely, combat oriented games should probably allow for a little longer sessions. Several games I know can turn a five minute battle in game into an hour long ordeal without even trying.
Since you didn't list a game system or a focus that's the most specific I can give you.