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.