early 15c., penitenciarie, "place of punishment for offenses against the church," also "a priest appointed to administer the sacrament of penance," especially in extraordinary cases, from Medieval Latin penitentiaria, from fem. of penitentiarius (adj.) "of penance," from Latin paenitentia "penitence" (see penitence).
The meaning "house of correction, prison in which convicts are confined for punishment and reformation and compelled to labor" (originally an asylum for prostitutes) is from 1806, short for penitentiary house (1776). Slang shortening pen is attested from 1884.
As an adjective, from 1570s as "relating to penance," by 1791 as "expressive of contrition."