Candy can be good to eat anywhere from one week to three years or more. The shelf life of candy depends on what type of candy it is and on how it is stored.
According to EatByDate, chocolate bars last two to four months when kept at room temperature and six to eight months when stored in the freezer. Jelly beans last anywhere from eight months to two years, while gummy candies tend to be good for about one year. Individually wrapped hard candies, such as Lifesavers, are good for one to two years, while candy canes last two to three years. Some candies, such as Gobstoppers, have an indefinite shelf life.