Basic rule of thumb is you don't want to lock out your knee when you pedal, nor do you want your hips to rock (seat too high). You also don't want too much bend in your knee at the bottom of the pedal stroke (seat too low). Most people end up with their seat too low as they think that they should have their feet flat on the ground while seated. That will result in too much bend in the knee (and likely knee problems down the road).
This is another perspective on bike fit:
http://www.rivbike.com/article/bike_fit/fit_sizing_position