what is the difference between jails and prisons

what is the difference between jails and prisons