Jails are temporary holding facilities, usually run by the local police force, where people stay for short terms if they only need to be locked up for a short period, or before they go to trial.
Prison is long term, usually run by the government or a private company, and it is where you go once you have been sentenced for your crime.