Some obstetricians prefer that you actually go into early labor before doing your cesarean. This means that as soon as regular contractions begin you will report to the hospital and have a cesarean performed. This allows your baby the longest and best gestation possible.
If it is best to avoid labor or if your practitioner prefers, you will pick a date between when you are 39 weeks pregnant and your due date. Waiting this long helps ensure that your baby is not born so early as to have more breathing problems at birth.
If you or your baby have specific medical needs that necessitate that your baby be born prior to 39 weeks pregnant it will be scheduled accordingly, perhaps after doing an amniocentesis to check for lung maturity. Be sure to talk to your doctor about why the early birth is needed and what it means to your baby.