A lot of variables in this question including distance, grade, and the gearing of your bike. But the most important factor is to know your hill. The best technique is to ride your usual hills solo (where you want to spank a buddie, or it is part of a race course) and figure out the rythym of the hill. I actually have spots on my usual hills where I know what gear I will be in where and whether I will be standing or sitting at certain points. If you are not happy with how you road a particular hill, if you are solo, turn back down and ride it again, until you get more efficient and figure out the best way to climb a particular hill. I always find stop and start points of particular hills and run an interval time to see how it compares with prior times. Even without a power meter, hills are one of the few places when actual time comparisions alone are great since gravity is a constant, and wind is not much of a factor. The Power meter makes it even easier to compare apples with apples.
All I know is that I don't like anybody to beat me up one of "my hills." Unless the other rider's watt to kg is really substantially better, you can beat a slightly better rider up the hill if you know how to ride that hill. If you have a race that has a few formidable hills, it always behooves you to check them out and fool around with different ways to get up quickly.
Gearing can be huge as well. On a big steep long hill, a compact crankset or a good granny gear can be a lifesaver. All things being equal, the guy with the 34/23 will beat and be fresher at the top than the guy pushing a 42/20 up a ten minute climb at a steep grade. I will gladly trade away an 11 or 12 hammer gear for a 23 or 25 granny on a course with a few long steepies. With ten speed rear clusters, these tradeoffs aren't as big a factor as when we ran 6s. To some extent, your gearing can dictate when you need to stand. If you run out of gears on a long climb and your cadence is still falling, you have no real choice but to stand.
.