Dried herbs will go stale the fastest, so like Trillian said, they'll lose potency. Ground spices will go stale much quicker than whole spices, and the more airtight the container, the longer the spice will last.

There are few spices that actually go rancid, but you'll know if a spice is too old because it just won't smell as strong. You can still use it, but you won't get much flavour.

I buy spices whole from an Indian grocery and either grind as needed, or with the more commonly used spices I grind enough for a few months. They are much more flavoursome than the pre-ground supermarket spices, and cheaper too!