A jail holds people for shorter periods of time or for pre-trial detention and is usually operated by a local government, typically the county sheriff. A prison or penitentiary holds people for longer periods of time, such as many years, and is operated by a state or federal government.