I would say that one should never sit going down hill. Standing allow you to shift your center of mass around, allowing you to move the bike around much easier. If look at trials riders, who arguably have the best balance/contol over a bike, they always stand. In fact most trials bikes don't even have seats. Up hill (as in going up the road before coming down the trail.) I would say it would depend on the geo of your bike. Being on the saddle you're using the majority of your energy to turn the crank, vs supporting your weight.
Additionally, Standing puts your weight on the pedals (lower center of gravity) instead of on the seat (higher center of gravity). The lower the mass distribution is on any 2 wheeled vehicle, the more stable it is.
Think super/sport motorbikes, the riders barely use the seat, all of the weight is on the pegs. Motocross riders sit down for traction out of the corners, but have most of their weight on the pegs when getting air or going over obstacles because it makes the bike more stable.
Mountainbiking (especially freeride and Dh) are similar to the above, in that if your weight is on the pedals, the mass distribution or contact point is lower down making the bike more stable and giving you more control. you can pivot the bike under you and lean it at more extreme angles without falling over.
That being said, I also miss the 2 cheese burger meal.