Here's the simplest explanation:
A cupboard is typically found in a kitchen and holds dishes, food, etc. The term may be a bit outdated in the U.S. but is used more often in the U.K., Canada, etc.
A cabinet is used more often in the U.S. instead of the term cupboard (e.g., kitchen cabinets). But generally speaking, a cabinet is also found outside the kitchen and is a place to store things like garage tools or clothes or cleaning supplies.
A closet is specifically for clothes and shoes. In the U.S., it's often a small room off a bedroom. Here in Europe, it's rare to find a house or apartment with closets; instead we use stand-alone armoires that are pieces of furniture. One can also use cabinets for the same purpose.
Hope this helps!