couple of simple things to get it roughly right, then fine tune afterwards by how it feels:
first set height so that if you ride around with heels on pedals your legs go about straight, without your hips rocking side to side, at the bottom of the pedal stroke. this way when you move the balls of your feet to the pedals you get a bit of bend.
second get a friend to look at you sitting on the bike with one crank forwards, your friend looking from the side (ideally the opposite side to the foot that is forward). From this position he can see where the spindle from the pedal comes through the crank arm. the front of your knee should be either directly above this point, or an inch or so back from it at most. further forwards and you are pushing backwards when you pedal, which can be bad for your knees, but further back may be ok and is favoured by powerful riders who prefer to push hard.
Thats very rough. If you ride a lot of technical trails you may want to be lower, enduro rides a tiny bit higher. Also, make sure the saddle is pretty much level – in fact it should be a "saddle" with a slight dip in the middle.
Hope this helps.
Chris