Primarily, the difference is that a jail is used by local jurisdictions such as counties and cities to confine people for short periods of time. A prison, or penitentiary, is administered by the state, and is used to house convicted criminals for periods of much longer duration.
I didn't realise there was a difference! Is the term penetentiary commonly used in the UK or is it more of an American thing, just ask because I once found myself i the "delightful" company of a lad who kept going on about when he was in the 'pen' made me want to scream "We're NOT in America, your NOT a gangster, get over yourself!!" but maybe that term is used here too and I just hadn't heard it before?