Proper posture is an important part of proper piano playing. In this lesson I am going to give you a quick overview of the proper way to sit at the piano bench. The first thing to make sure of is that you do not slouch. Slouching limits your mobility on the keyboard and will have a negative impact on your piano playing. Slouching also doesn't look so attractive when you are on stage playing for thousands of people. So be sure to sit up straight every time you sit down to the piano.
The next thing to make sure of is that your elbows are at a 90 degree angle. If your elbows are outstretched further than that, you have your piano bench set to far back. If your elbows are pushed back behind your body, then your piano bench is to close to the piano. Sitting a proper distance from the piano also insures that you will have the full reach and mobility that is needed to play the instrument.
As you get into a song and the emotion starts flowing, you may find yourself naturally leaning into the piano, or hunkering down to really jam out. This can be called artistic movement, and is perfectly acceptable. The guidelines in this document are designed to make sure that you have a solid foundation when you are starting to learn the instrument, not to limit your expression.
Also, check out the video on Proper Hand Posture to make sure you are playing the piano with the proper technique.