Sealed coffee including sealed ground coffee and sealed coffee beans can last a long time as long as they remain sealed.
After a year the coffee will lose it's freshness so the coffee when brewed may not taste as good as when it was fresh but the coffee even a year or 5 years later or even longer is still safe to drink.
As long as the sealed coffee is stored in a dry cool place it can last a long time.
But if you like your coffee fresh it's best to use the coffee up within a month or two months and get more fresh coffee.
I use coffee up well within a month because I sometimes go through 2 cans of coffee each month because me and my husband drink coffee a lot.