It heavily depends on the number of players and enemies (a CR +0 encounter for 4 characters takes significantly less than a CR +0 encounter for a party of 8, and a CR +0 encounter for the same party could be composed of many weaker monsters or a single boss), on the availability of save-or-die spells and whether they land or not, on the complexity of rules involved in your PCs and NPCs (sometimes, finding the rules to grapple in D&D 3.5 greatly slowed the game. I'm pretty sure there are equivalent situations in Pathfinder too), on the players being attentive or not and, on the increasing number of options for high level monsters and PCs and, in general, on lots of independent factors that's impossible to predict in advance.
(I had gaming sessions with 5 encounters easily solved in the same 3-hour game night and in the following encounter the same time was used to play the first turn and a half of a combat, just because of a silence spell forcing the casters to be creative.)
I've come to the conclusion it's downright impossible to pre-determine the duration of an encounter before playing it, unless you fiddle with monster's HP on the run, having your enemies last longer or die faster as needed... which is probably not the game experience you were looking for and feels a little like cheating them to me, not letting their expertise or luck shorten an encounter and ultimately preventing theem from actually influencing the outputs of (that part of) your narration.
However, I feel there still is something you can do to prevent that feeling of sloppiness.
Have your encounters be meaningful. No more filler encounters, random goblins in a side-room. If you don't want to skip that room because it makes sense in the dungeon, consider having the monsters in there really weak and skip the actual combato, or even better offer your players to spend some resources ("...You lose 30 hp and 3 levels of spells and you win. Is this ok or do you want to play it?")
This means shorter dungeons and less time spent in useless goblin-mashing, which should make dungeons more interesting.
On this page, the dungeon's lenght should be tied to what the dungeon is in the game world (are they exploring some dwarven mines? That could be huge) but if you want to go for a less realistic but more gamey perspective, a dungeon should be clearable without going to rest. This usually means 4-6 encounters in my book, to be played over 2 or 3 gaming sessions. Your Mileage May Vary.
Another option is googling for some 5-room-dungeons. These are a series of 5 "rooms" (true, they are called dungeons, but the same structure is often used to describe any string of different places) following an identical structure:
- Room One: Entrance And Guardian
- Room Two: Puzzle Or Roleplaying Challenge
- Room Three: Trick or Setback
- Room Four: Climax, Big Battle Or Conflict
- Room Five: Reward, Revelation, Plot Twist
Five rooms, one to three combat encounters (in rooms 1, 3 and 4) feels like a popular choice.