Dried cannabis with a moisture content of ~10% will keep around a year before potency starts to decline. This figure is considered optimum for preserving taste smell etc, while still reducing potential for mould growth.
From Marijuana Botany, by Robert Connell Clarke
Usually about 10% water content remains in dry, stored cannabis floral cluster prepared for smoking. If some water content is not maintained the resins will lose potency and the clusters will disintegrate to a useless powder exposed to decomposition by the atmosphere
Despite this statement, an old grower I knew dried and handled his buds with incredible care. He dried all product to as dry as possible using silica, which was way less than 10%, and stored in vacuum sealed containers underground. When he dug up some personal, he re-hydrated it by leaving out overnight. I have had his 5 year old weed and it still seriously kicked ass.
Drying cut floral clusters to a moisture content of ~10% takes about 2 weeks of air drying in a non humid (preferably dark) environment. Although heads may feel dry before this, water still remains in the stalk. Curing a whole plant by hanging takes much longer as moisture must escape through the tiny stomata on the surface of the leaves and calyxes, and these close up shortly after harvest. A good test for dryness is to break a stalk. It should snap in on the first bend. Bringing dried buds "out to air" is regarded as important in the curing process, but ideally at other times they should be kept under nitrogen or some inert environment (not CO2).
As for molds; the blue coloured molds are regarded as being the most toxic. High Times did a big article on this subject in the early 80's. Avoid the blue mold!!!
In Morocco, sometimes mold is actually encouraged - well a certain type of mold anyway. A technique I heard about involved placing the hash/bud under a particular type of clay pot. The mold would begin to grow quickly and it was reputed to enhance the quality.
Smoking any mold should be avoided altogether IMHO. As mentioned in the preceding posts, the appropriate harm reduction messages for keeping your weed are probably to; dry to around 10% H2O content, store carefully in a dark cool place and use within 12 months. If it smells even slightly of ammonia, throw it out. Fresh IS Best after all
If you freeze as BT suggests, handle gently during thawing as the detached resin globules could end up sticking to the bag.