As casual coffee drinkers from around the world continue to broaden their palates, as well as their wealth of coffee knowledge win general, there is one aspect of coffee production that is now widely viewed, and fixated upon, as being one of the most determinate factors when choosing a coffee...the roast date.
WHAT IS 'FRESHLY ROASTED' COFFEE
"Fresh is always better." This is the consensus for almost everything we consume, be it food or otherwise. While this is generally true with most things, coffee is a little more nuanced and deceptive with regards to its 'freshness' as well as consumer expectations of how said 'freshness' actually correlates with a delicious cup of coffee. Unlike something like cake, bagels, fish, a loaf of bread, etc., which are objectively better the fresher they are, the process by which coffee becomes that realized delicious roasted bean you brew every morning still continues AFTER it is roasted and bagged.
Properly roasted coffee is a balance of thermodynamics, chemistry, and time. The vast majority of that 'time' component actually comes after the beans leave the roaster. For days after a coffee has been roasted, it will continue to off-gas carbon dioxide (CO2). This CO2 is a 'by product' of the chemical reactions that occur during the roasting process, and is the reason why most (good) coffee bags contain a one-way valve to allow for this gas to escape, while preventing air from getting in.
THE 'FRESHEST' YOU WANT TO GO
As a general rule, you don't want to brew any filtered coffee (drip machine, pour over, chemex, etc.) that is less than 3 days from its roast date. For espresso, you want to wait 5-7 days. Roast levels, origins, and varietals will affect these timeframes somewhat, but the takeaway here simply is to NOT brew coffee that is still off-gassing, i.e. 'fresh as possible'. Here's why...
When you try and brew coffee that is less than 72 hours old, you are essentially under-extracting your coffee due to what amounts to a microscopic 'forcefield' of sorts being generated by the expelling CO2 leaving the bean. For a 'good cup of coffee', you need proper extraction. At its most fundamental level, this requires that the hot water from your brewing method comes into direct contact with the surface area of the solids you are trying to dissolve into solution. Because you are unable to extract those yummy solids you want into your cup when you try and brew a ultra freshly roasted coffee, and are only getting the more unpleasant ones, your coffee will come out very 'roasty tasting'...which is another word for unpleasantly nutty, sour, and/or papery.
Many times when people brew coffee a day or two off roast, they will experience these flavors and deem the coffee (and brand) as bad, throwing the entire bag away. If that same person had simply waited a couple more days, that coffee would taste very different, and likely as expected.
WHEN AGE STARTS TO MATTER
So hopefully you've now come to the realization that coffee brewed that's only 8 minutes old is going to taste terrible compared to that same coffee brewed at 3 days old. Now that we've established that, you need to understand the time frame(s) in which coffee will maintain its flavor profile and appeal. Again, like everything with coffee, there are numerous variables that determine the length of time in which a coffee will still remain delicious and pleasure when brewed.
Speaking for our coffees only, almost all of them will maintain a level of brightness, 'freshness', and intended flavors 4-5 weeks from roast date...with those coffees that are roasted darker and/or contain less fruit acidity lasting far beyond that timeframe. Even past these timeframes, most of our coffees will still taste good to drink. When you start getting into the 2 month range, the refined palate will notice a 'dullness' or 'muting' of flavors. Naturally processed coffees can also begin to exhibit more of a fermented type flavor profile as those fruity acidities have begun to oxidize.
NOT ALL DATES ARE CREATED EQUAL (OXIDATION IS WHAT DESTROYS COFFEE)
Now these aforementioned timeframes are based upon when the bag is opened and exposed to air, as this is when the clock really starts with regards to the oxidation (staleness) of the beans. A bag of coffee that is 5-weeks from roast date, that has been open for 3 weeks, will not taste the same as a newly purchased (sealed) bag with the same roast date. This is due to the fact that the opened bag has been exposed to air 3 weeks longer than the sealed, and is therefore going to be 'staler' than the sealed bag.
And DO NOT FREEZE OR REFRIGERATE COFFEE! Contrary to your grandma's wisdom, this does not keep coffee 'fresher'. In fact, the molecular processes this practice induces will cause your coffee to taste stale almost immediately. Remember, oxidation (exposure to air) is the enemy of coffee, not how fast the molecules in the beans are moving. Just trust us on this without being fully elucidated with the science..don't do it.
So hopefully this helps in guiding your approach to purchasing and brewing a little bit better. It's really not necessary, or advised, to always reach for the bag of coffee that was roasted 5 minutes prior; especially if you're wanting to brew it right when you get home. Nor is it reasonable to expect a coffee roasted 2 months ago, and has remained open for 6 weeks of those months, to taste nearly as good as it would have from a month prior. Coffee is its best when it's being brewed some time within its 'sweet spot' time period (1-5 weeks). Like most things in life, successful achievement of a goal lies in the nuance of the approach.