A cupboard (or closet/wardrobe) is a furnishing in Amnesia: The Dark Descent, and are quite numerous in living spaces. They have doors that can be opened, allowing hiding inside of them.
Closets are very good for hiding - you cannot see the monster while inside, thus hindering your sanity from being drained. It can sometimes be safe to use your lantern inside, but this isn't recommended as monsters may sometimes see your light through the cracks in the doors.
If a monster sees you in a closet, it will stand next to the closet and examine it. The chances of survival while it does are pretty random - even if it looks directly into the closet, it still may not notice you. If it discovers you, it will start tearing down the door. If you stay quiet, turn your lantern off, and crouch, it may leave before it tears the door down.
Cupboards are not a recommended hiding spot at "..." sanity. Because of their darkness, your sanity will drain fast in them, and after a few seconds inside one at this stage, Daniel will fall down to the floor, alerting nearby enemies to the closet.