There are two types of punishment resulting from being convicted of a "Driving under the Influence" (DUI) (also known as an OWI, DWI, or OVI in different states) charge. The first type of punishment is administrative and results in having your license suspended. Read more about the administrative hearings for license suspension. The second type of punishment is under criminal law and results in fines, parole and prison/jail time sentencing. The conviction goes on your criminal record and whether you can later remove (or "expunge") it depends on the charges and your state's laws. Read expunging criminal records to learn more.
Since license suspension is an administrative action, you can lose your license prior to being convicted of a DUI charge, and it can be taken at the moment you refuse or fail to take a sobriety test - long before your case even goes to court. In some states your license will be suspended at the moment you are arrested for a DUI even if you have been cooperative and taken all the required blood alcohol content (BAC) tests they give you.
As for the criminal record, the following generally takes place. Following your arrest for drunk driving, you will be taken to court for your arraignment. If the evidence is sufficient to go to trial, you will go to trial or possibly work out a plea bargain with the prosecutor. Following these processes finally comes the sentencing phase. In most cases your DUI charge will be classified as a misdemeanor but it can nevertheless land you in jail for as long as a year; a felony charge can put you in state prison for longer than a year.
Your defense lawyer may challenge the BAC testing and its reliability by having an expert witness offer evidence that you were not under the influence when you were arrested by providing documentary evidence that proves that the blood alcohol testing equipment was not calibrated correctly or recently.
The sentencing phase of the process will determine how your conviction is classified, what fines you will be required to pay, the length of time your license will be suspended, whether or not you will need parole or community sentence, what drug or alcohol program you will need to complete, and whether or not you will need to have an ignition interlock device installed on your vehicle.