Jail is where offenders are housed after an arrest but before a conviction. It's the "waiting" room when those convicted will end up in prison but not until that time. Depending upon the judge and charges bail may be granted during the time that the case is resolved. For those not offered bail or unable to make bail, they remain in the jail until their case is resolved. For shorter sentances such as a year or less, the jail will often keep the offender without transferring them to a prison.
Prison is where offenders are sent upon conviction, wheter that conviction came from a plea deal or a jury trail's guilty verdict the net result remains the same. The presumption of innocence is no longer assumed so prisons are usually a more strict environment.
When dealing with incarcation the first question is whether or not the offender is in jail or prison so what's the difference?