There are many different types of prison. Prisoners will be sent to a specific facility depending on the type of crime (petty to violent), and the level of law that has been broken (state, federal, military).
Here's a quick run down on the major prison categories:
Juvenile: Reserved for young (under 18 years of age) prisoners.
Minimum Security: Reserved for committers of non-violent crimes. Prisoners are often incarcerated for "white-collar" crimes, such as fraud. Security is minimal and accommodation is often dormitory style.
Medium Security: The next step up, medium security prisons are what most people think of as "prison". Personal freedoms are fewer than in a minimum security facility and the daily routine of inmates is more regimented. "Cage" style accommodation is often used.
Close Security: Here prisoners are usually housed 1-2 per cell. Each cell has toilet facilities. Inmates may leave their cells for work programs, or to use common areas.
Maximum Security: Maximum security is reserved for offenders of the most violent crimes. Guards are armed and plentiful. Every inmate is regarded as dangerous. The USA also has a Supermax prison facility.
Psychiatric: Psychiatric prisons often resemble hospitals. They house inmates who are deemed "mentally unfit."
Military: Military prisons house prisoners of war and personnel who have broken national security laws. Every branch of the military has their own prison facilities.
Federal or State? If someone commits a Federal crime, then they are likely to be sent to a Federal prison -- the exception being violent crime. Federal prisons also prohibit parole.