Your bike must be big enough to prevent your knees from hitting the handlebars but not too big. You do not want to have to stretch too far.
This picture shows the rider in a far better position. Your leg should not be straight at the bottom of the pedal stroke but slightly bent. With the heel of your foot on the pedal your leg should be straight. When you pedal using the ball of your foot your leg will be slightly bent at the bottom of the pedal stroke.
You must be able to touch the ground.
Your saddle can adjust in three ways. Most have a simple allen key under the seat and a clamp or a quick release on the frame. The seat should be set-up level. If you find yourself slipping forward often then tip it backwards a small amount.
Adjust the height so that with the balls of your feet on the pedal, your leg is slightly bent at the bottom of the pedal stroke. This is how you should be riding, with a slight bend in your knee.
To check the position is correct. With the pedal in the same position, place the heel of your foot on the pedal this should result in a straight leg.