Jails are run by counties or cities, and are for persons awaiting trial (i.e. not been convicted) or persons found guilty and serving short sentences.
Prisons are run by a state or by the Federal government, and are for holding persons who have been convicted of a crime and sentanced to a longer term.