Sugar lasts for up to 2 years once opened as long as it doesn't get bugs or ants in the sugar.
When you open a bag of sugar it's best to put the sugar into a sealed container to keep ants and other bugs out of the sugar.
Then when it remains sealed the granulated sugar can last for 5 years and even longer.
Sugar has a good long shelf life as long as ants and other bugs stay out of it.
Even if the sugar clumps up you can still use a hammer or something to break up the sugar and it can be used again.
Store the sugar in a cool dry place without a lot of humidity and the sugar will last nearly forever.