Shelf life is how long food can be kept safely. Food cannot be kept forever. After a certain time it will go bad. After this time it is no longer safe to eat it. Shelf life also used for drugs, drinks and other things that can go bad.
In some countries, a best before, use by or freshness date must be put on packaged foods.