“Pokey” as slang for “jail” dates to early 20th century America and is actually a variant form of “pogey,” a 19th century English word for “poorhouse” or “welfare hotel.” The roots of “pogey” are largely a mystery, but the word may be related to the adjective “poky,” an interesting word in itself. The original sense of “poky,” in the 18th century, was, logically, “something that pokes,” i.e., projects or points out (as in a “poke bonnet,” a style of the day that featured a prominent brim). In the 19th century, the word came to mean “cramped or confined,” as a small room might make a resident feel “poked at” by the walls. Since jail cells are not known for their generous elbow room, this is probably the connection between “poky” (cramped) and “pokey” (jail).