late 14c., "a small private room for study or prayer," from Old French closet "small enclosure, private room," diminutive of clos "enclosure," from Latin clausum "closed space, enclosure, confinement," from neuter past participle of claudere "to shut" (see close (v.)).
In Matthew vi.6 it renders Latin cubiculum "bedchamber, bedroom," Greek tamieion "chamber, inner chamber, secret room." Modern sense of "small side-room for storage" is first recorded 1610s.
The adjective is from 1680s, "private, done in seclusion;" from 1782 as "fitted only for scholarly seclusion, not adopted to the conditions of practical life." The meaning "secret, not public, unknown" is recorded from 1952, first of alcoholism but by 1970s used principally of homosexuality; the phrase come out of the closet "admit something openly" is first recorded 1963, and lent a new meaning to the word out.