A prison, gaol, or jail, was a place of confinement, typically for criminals.
After being imprisoned by the Sheriff of Nottingham, the Twelfth Doctor and Robin Hood escaped by knocking out a guard and taking his keys. (TV: (GAME: Robot of Sherwood [+]Mark Gatiss, Doctor Who series 8 (BBC One).)
In 1881, while in Tombstone, Arizona, the First Doctor was imprisoned by Wyatt Earp who believed this would be safer for the Time Lord who was believed to be Doc Holliday by Seth Harper and the Clanton brothers. A mob, egged on by the Clantons, gathered outside the prison demanding that Holliday be released into their custody and threatening to hang Steven Taylor if not. Earp attacked the group and managed to release Steven. The Doctor was released and surreptitiously removed from the prison. (TV: The Gunfighters [+]Donald Cotton, Doctor Who season 3 (BBC1, 1966).)
The Master was imprisoned on Fortress Island where he was visited by the Third Doctor. He escaped with the assistance of George Trenchard. (TV: The Sea Devils [+]Malcolm Hulke, Doctor Who season 9 (BBC1, 1972).)
The Fifth Doctor and Nyssa were briefly locked in gaol on Manussa during the 500th anniversary of the banishment of the Mara. (TV: Snakedance [+]Christopher Bailey, Doctor Who season 20 (BBC1, 1983).)
Occasionally, mugshots were taken of convicts to process them for imprisonment. After being caught with a vehicle carrying stolen merchandise which they themselves stole, the Doctor and Sarah Jane Smith were lined up for mugshots. Both of them struck cheesy grins, mocking their frustrating predicament. (TV: Invasion of the Dinosaurs [+]Malcolm Hulke, Doctor Who season 11 (BBC1, 1974).) The Ninth Doctor, having witnessed his companion seemingly killed before being arrested by the security of the Game Station, faced his mugshot with a stoic look. (TV: Bad Wolf [+]Russell T Davies, Doctor Who series 1 (BBC One, 2005).)
UNIT maintained a prison where detainees were held without trial or legal representation indefinitely. Toshiko Sato was taken to this prison but was later released after Captain Jack Harkness offered her a position at Torchwood. (TV: Fragments [+]Chris Chibnall, Torchwood series 2 (BBC Three, 2008).)
Romana I was put into a prison cell by Count Grendel of Gracht. There, she tended to her fellow prisoner, Prince Reynart. (TV: The Androids of Tara [+]David Fisher, Doctor Who season 16 (BBC1, 1978).)
Keystone Jail was a jail. While rent collecting, Basil Brush may have been arrested by the Keystone Kops and placed in the jail. (GAME: Basil Brush goes Rent Collecting [+]TV Comic games (Polystyle Publications, Ltd., 1969).)
By his eleventh incarnation, the Doctor had been imprisoned in the Tower of London five or six times. (PROSE: Touched by an Angel [+]Jonathan Morris, BBC New Series Adventures (BBC Books, 2011).)
In the 52nd century, River Song was imprisoned in Stormcage, though she frequently escaped. (TV: The Impossible Astronaut [+]Steven Moffat, Doctor Who series 6 (BBC One, 2011).)
A pocket universe was utilised as a prison to house Eugene Tacitus after he murdered his own son. (AUDIO: The Holy Terror [+]Robert Shearman, Main Range (Big Finish Productions, 2000).)
The Judoon prison was an intergalactic prison. The Thirteenth Doctor was held there for twenty years for 7001 individual crimes, her original sentence would have expired on December 31st, in the year 100 Trillion. (TV: Revolution of the Daleks [+]Chris Chibnall, Doctor Who New Year Special 2021 (BBC One, 2021).)