Our bodies have a natural inward curve of the spine in the lumbar (lower back) area called "lordosis". Slouching at your desk while sitting places greater stress on the vertebrae in that area, especially around that L4-L5 region. About 80% of people experience back pain at some point in their lives. Much of this can be avoided by proper posture.
There is also a natural lordosis (inward curvature) in your cervical vertebrae (neck area where it attached to your head) that gets comprimised with poor posture. This can cause your head to assume a more forward position (protracted) and place stress on those vertebrae as well.
Slouching while sitting also affects your respiratory (breathing) actions, compressing the lungs and diaphragm. This will in turn deplete your energy and brain power over time.
Proper sitting position: (possibly aided by a low-back cushion) The lumbar spine (lower back) assumes a more normal lordosis (inward curve), which facilitates a more desireable "chin-in" (retracted) position of the head. A good way to stay in good sitting posture is set a timer at your desk for every 20 minutes to remind you to re-align, and hear Mom's words echo in your head, "Sit up Straight"!