Olives should be eaten within 18 months if they're canned or packaged, and roughly 2 weeks once opened or if purchased fresh. However, this can depend on storage and handling.
Generally, liquid-packed olives will always last longer than dry-packed, as submerging them in brine or oil can help preserve textures and flavors and minimize bacteria.
A key way to tell if olives have gone bad is their scent. If the packing liquid (oil or brine) smells putrid or the olives themselves have a funky aroma, it's wise to discard them.
Fuzzy olives should be tossed immediately. If the liquid develops a layer of white film, simply scoop it off, add a splash of vinegar, and eat them as you normally would.
If your olives pass the sniff test but you notice that the flavors are slightly off, it's best to toss them and pick up some new varieties during your next market run.
Carefully examine the packaging. Dented cans, bulging jar lids, or torn vacuum packaging can all indicate that the quality is compromised and the olives need to be discarded.