Jail is a place that is temporary. People are serving short sentences or waiting for court.
Prison is a place for long term sentences set by trial judges.
Jail is a "holding cell" before individuals are sent to prison. Jail is a temporary assignment. Once the individual is deemed guilty by the court; they are sent to prison.