Pond foods will have a best before date on the packaging. For FishScience food sticks this is 18 months from the date of manufacture, for the flakes it is 36 months. Once opened the foods should be kept in an airtight container away from moisture, direct sunlight and excessive heat.
Moisture is the biggest problem and will be quickly absorbed by the dried foods leading to them going mouldy.
If you are buying large packs of food that will last for several months, consider decanting a small quantity out of the pack to feed to your fish for 1 – 2 weeks. In this way the bulk food can be kept in good conditions and will last longer.