You may know that many aged cheeses are allowed to mold as part of the aging process. And, of course, blue cheese and Roquefort cheese have special molds that are purposely added as part of the taste and texture. However, this does not mean that the mold that grows on cheese in your refrigerator may not be a harmful mold. You should not eat cheese that has mold on it.
However, it is usually okay to simply cut away the mold from the outside of a block of cheese. The FDA Model Codes for Food Service recommend cutting at least one inch beyond the moldy area. Try to keep the knife from touching the mold itself.
See also: Can You Cut the Mold off Bread and Still Eat It?
Cutting Mold off Cheese
If the cheese has mold on more than one side, you may want to clean the knife between trimming each side to avoid transferring any mold from the knife to the cut surface. You also need to try not to transfer mold from your finger to the newly cut cheese. If a large part of the surface of the cheese is covered with mold, it may be difficult to remove it without contaminating the fresh-cut unmolded surface. In this case, you’ll have to use your best judgment, but the cheese may be too far gone.

If you can do this, then your cheese should be fine for eating or for cooking. Once you have removed the mold, re-wrap the cheese and return it to the fridge if you’re not going to use it right away.
The mold removal rule goes for soft ripened cheeses like brie, Camembert, or Limberger as well as hard and very hard cheese like cheddar, Gouda, Parmesan, Romano, etc. Brie and Camembert have white surface molds, so any other type of mold that shows up should be removed.

The exception is soft unripened cheeses like cottage and cream cheese, because the mold is likely to have permeated through the cheese. Also, by the time these types of cheeses have mold, they probably have bacteria growing in them as well. These should be discarded if mold develops. Otherwise, for most cheeses, the mold probably will not be able to penetrate very deep so cutting it away (with some extra margin of safety) should effectively remove any danger.

As above, blue cheese and Roquefort cheese have special mold (Penicillium roquefortii) already in them. However, other types of harmful mold can still grow on the outside of these cheeses, so any mold on the outside that is a different color or looks different from the mold already present in the cheese should be removed.