For a quick fit, the general goal is to keep the seat high enough that you can get a nearly-full leg extension, without 'locking' the knee.
Over a long period of time, if you find that you are having knee, foot or hip pains, try making small adjustments with the saddle, about 0.5-1.0cm at a time, either up, down, forwards or backwards. If the pain gets worse, try the other direction. Give it some time, and eventually you should find a painless position.
A tip I recently got from a friend having a similar problem proved interesting: Those of us who are males typically 'dress' right or left. For him, aligning his saddle with the nose turned slightly off-center (away from the direction of 'dressing') alleviated all of his knee discomfort!