The phrase "do time" is an idiomatic expression used to indicate a term of incarceration, usually in a jail or other penal institution. For example, someone who is convicted of a felony might do time. The phrase appears to have originated in the US sometime in the early 20th century, but the precise origins are unknown.
In most cases, someone is said to do time in a jail or prison as punishment for a criminal act. The phrase might also be used to describe a term of incarceration in a juvenile detention facility. In some cases, it might be used to refer to any situation that occurs for a fixed period and from which someone wishes to escape. For example, someone who is eagerly anticipating an impending retirement may say that he is "doing his time," or "putting in his time."
This particular saying can change tenses based on the period referenced. Someone who has not yet been imprisoned might "do time," while someone currently in jail is "doing time." Someone who was imprisoned, but is not currently in jail might say that he "did time" or be asked if he has "done time."
The word "time" in this expression refers to the fact that prisoners are sentenced to a specific amount of incarceration time. The phrase may be altered to include the actual amount of time. For example, a former prisoner might say that he "did three years in state," meaning that he spent three years in a state penitentiary.
Several other common slang phrases are associated with jail time. Someone who is incarcerated might be said to be in the "clink," "pokey," "joint" or "big house." Someone who is sent to jail might be said to have been "sent up the river" or "thrown in the slammer." A prisoner might be called a "jailbird" or a "con," short for "convict."
Other associated phrases refer to the amount of time someone did, will do or is doing. A person who "did a dime" was incarcerated for ten years. Similarly, someone who "did a nickel" was imprisoned for five years. "Doing life" refers to someone who has been sentenced to life, usually without the possibility of parole.
The phrase "do time" should not be confused with the phrase "due time," which actually means something quite different. "Due time" refers to a moment or point in time in which something becomes appropriate or necessary. For example, the resolution to a problem may be implemented "in due time."