A water closet or W.C. is a toilet that uses water to flush away waste bodily products.
As an adjective closet means secret, private or confidential. So that "closet prayer" is prayer that is performed privately rather than as a group activity such as the start of a school class. A closet sin, is one that is committed in privacy and seen only by God. If someone is described as a "closet communist" or a "closet homosexual" then it means that they have not made their true identity public.