Photo by Frank Jakobi/Flickr CC
Storage is a complicated subject. This is a quick overview, and there are some specific circumstances that will be neglected. We'll pick those up later or in response to comments.
Once you have your coffee beans at home, the best indicator of freshness is aroma (at room temperature) and taste. A visual indicator is the amount of "bloom" when you pour the water over the coffee. Coffee roasting creates significant amounts of carbon dioxide within the bean. Grinding releases the CO2, which carries the aroma into the room. (Smells great, doesn't it?) The remaining gas will be liberated as foam during brewing. Generally, the more bloom there is, the fresher the beans. (Geek note: the volume of CO2 varies among varieties. The range is three to 20 times the bean volume.)
All coffee is fresh when it comes out of the roaster. What happens later changes the freshness profile profoundly. The very best practice, of course, is to buy your beans weekly at a reputable shop that carefully monitors its inventories and refuses to sell beans past several days out of the roaster.
Oxygen, time, and temperature are the enemies of all food freshness, and oxidation accelerates with higher temperature and slows with lower temperature. I recommend the refrigerator for coffee beans that will be drunk within a week or two. [Curator's note: Unlike Jerry, I'm not a refrigerator guy--ground coffee is an ancestor of baking soda as a refrigerator deodorizer, but if you've got it in an airtight container, you'll at least avoid onion-y coffee.] For longer storage, use the freezer--but observe the caveats below.
N.B. If you are making coffee in an espresso machine, leave the coming day's coffee at room temperature, sealed, away from heat. Cold coffee, directly from the refrigerator, will chill the brew, diminish the crema and inhibit good extraction. For all other methods--assuming proper brewing temperature of 195 to 205° Fahrenheit--brewing the coffee from the refrigerator will not significantly affect the brew temperature adversely because of the high ratio of hot water to coffee grounds.
Unscrupulous roasters have been known to load their coffee with as much as ten percent moisture to increase their profits.
Use the freezer for longer storage. For example, if you bring home a pound of beans, divide it into weekly amounts to store separately. For this week's coffee, leave it at cool room temperature or seal it and put in the refrigerator. The remaining weeks can be put into the freezer to be removed a week at a time.
I don't recommend taking the coffee back and forth from the freezer to the brewer each day because this coffee soon begins to taste flat. I suspect this is the result of condensation on the beans when they are opened in a much warmer atmosphere. The repeated condensation being absorbed into the coffee is what seems to cause the negative effect. [Curator's note: I think it goes flat very soon! The open question is distribution of the flavor-bearing oils in beans and whether after freezing, in which the oil is redistributed, it ever diffuses to where it was in the beans; for more on the discussion, see my chapter on storage in the Baldwin-filled Joy of Coffee.]