Dried herbs may not be your first choice when cooking a dish. Everyone prefers to use fresh ingredients but dried herbs last a lot longer than their fresh brethren and you need a lot less to get the job done. As a general rule, if a recipe calls for a fresh ingredient, you will only need about a third of the amount of the same dried ingredient. Dried spices also admittedly add a great deal of convenience to cooking. But just because dried herbs will last longer, it does not mean they will keep forever and they do eventually go bad and lose their potency. Once the herb or spice starts losing its aroma or no longer smells like it should, then throw it out because it will not have the flavor it should either. Dried herbs will last at least a year or even a bit more if you take the time to store them properly. Some dried spices will last even long than that.
Whether you dry your own herbs, or buy already dried herbs from the supermarket, the first thing you should do is make sure they are in an airtight container. Glass canning jars are preferred over any sort of plastic. Plastic, though it seems airtight, can actually be permeable and cause your herbs and spices to lose potency sooner than in a glass container. Store-bought herbs and spices generally come in a plastic container or bag. If you plan to use your herbs relatively soon then these containers are fine.
Avoid moisture, heat and light
Keep dried herbs and spices away from moisture, heat and light. They should be kept in opaque containers if you have them or you can simply put your clear glass jars into a brown paper bag. It is always good to keep herbs and spices in closed cabinets away from the stove or other heat sources. Direct heat and also ambient heat from light will shorten the lifespan of everything from oregano to thyme. Moisture, obviously, will ruin herbs and spices and can cause them to grow mold. The airtight container should prevent moisture.
Only crush as much as you need
If you dry your own herbs, store them whole and crush them as you need them to prolong their flavor. Whole dried herbs will generally keep for up to two years. If you crush them they keep for around a year. If they are a powder, they will only maintain their potency for about six months.