First off, the Victor crew wants to point out it is better to buy whole beans rather than ground coffee. Why? Because you wanted the freshest cup you can get. Storing them in bean form helps protect the quality in and of itself. Once the bean is broken, the coffee oxidizes quickly. It is best to grind right before you brew.
For the best filter brewed coffee, it is better to get it as close to the roast date as possible. But note that coffee needs a day or two of rest after it is roasted before using it. This helps any gas trapped in them to escape. For espresso, you want to rest the beans for about five days. If you can, get your coffee within three to ten days from the roast date.
It also helps if you store the beans correctly. Paper bags will lose the flavor quicker. Try to use sealed one-way valve foil bags. If it comes in one, leave it in. If it is in a paper bag, transfer to an air-tight container kept out of sunlight.
Don’t freeze or refrigerate your coffee. When it thaws it won’t taste the same. Also it may pick up flavors from items in the freezer or refrigerator. In the refrigerator, it may pick up condensation and push oils to the surface and age the coffee faster. If you stock up and already have a few bags go ahead and store in freezer but thaw to room temperature. It won’t taste the same.
Source