Dog food usually expires within a year of purchase or sooner but the dog food is still safe for the dog to eat.
Although the dog may not want to eat the stale food. I would not buy anymore dog food than your dog will go through in one month.
Of course you could buy 2 bags per month so you would have enough to last for one month and then part of the next.
Or if you think there will be a snow storm or other disaster where you can't get to the store to get dog food then you could stock up enough dog food to last throughout the storm.