Sentencing can vary depending on the location of the case, the crime, the judge (and sometimes jury), and other specifics of the criminal case. In some cases a punishment for a particular crime is governed by the federal sentencing guidelines, and the judge does not have a big impact on determining the punishment. In other cases, the sentence is up to the judge's discretion, who will take a variety of factors into account when determining a convicted offender's punishment.
The most common punishments for a criminal conviction include: incarceration (in jail, prison, or another detention facility), punitive fines, restitution (compensation to the victim), probation, and community service. There are a variety of other penalties that may be more specific to the criminal case. For example, if you are convicted of a DUI or DWI, you may be required to attend a DUI school or a drug/alcohol treatment program, have a Breathalyzer installed in your vehicle, face driving sanctions, and more.