A closet was a small storage area where clothing and personal items were kept.
In 2372, an embarrassed Julian Bashir lied to Ekoria about keeping his old stuffed animal Kukalaka in a closet somewhere, quickly admitting it was actually in a shelf in his room. (DS9: "The Quickening")
In 2373, Quark found Grand Nagus Zek (who was courting Ishka) and his servant Maihar'du hiding in his closet; later Liquidator Brunt materialized there so as not to disturb the couple. (DS9: "Ferengi Love Songs")
Closets could also be used as places of confinement, either as punishment or to keep somebody from interfering with one's plans. In 2285, Nyota Uhura locked an eager lieutenant into a closet at phaserpoint. (Star Trek III: The Search for Spock) Elim Garak's father locked him in a closet for misbehaving. (DS9: "Afterimage") In 2374, hearing of Tom Paris's repeated escapes from his stasis unit, Harry Kim asked him whether he'd been locked in dark closets as a child. (VOY: "One")
In addition, any tight confined space could be metaphorically referred to as a closet. In 2374, Leck referred to both Brunt's shuttle and the infirmary on Empok Nor as closets. (DS9: "The Magnificent Ferengi")