How long you keep spices will depend on how they are stored. Generally, if stored properly in a tightly closed container, ground spices last up to three years.  Whole spices tend to last a bit longer, up to four years.  The best way to evaluate the freshness is to smell them.  If they have lost their aroma, are clumpy, or just don't look or smell right, then it's best to throw them away.