First, you should know that the biggest concern isn't that the dried herbs and spices are "bad"—as in they'll make you sick. That is very unlikely to happen unless the contents of the jar somehow come in contact with other food or liquid.
The real issue is that, over time, dried herbs and spices simply lose their oomph. Color and flavor fades, rendering them somewhat useless. The best way to tell if your dried herb or spice still has its mojo is to give it the crush test. Crush a pinch between your index finger and thumb: you should immediately get a rich, full aroma. Also, color fades with time: do your red spices look more brown and your green herbs look grayer? It may be time to replace them.
You can take much of the guess work out by marking the spice jar label with a date when you bring it home. Most dried herbs and spices keep their flavor for 6 – 12 months.