If you maintain moisture levels, cover it, and store it in a dry location, compost left in a pile, bag, or container for too long can remain usable for years.