We get this question ALL the time, and sometimes end up in long discussions about the myriad theories and methods people have come up with or learned over the years.
If you're curious, perhaps interested in coming up with your own new method, there are 3 important factors: Oxygen, Temperature, & Light.
Overall, one of the best things to remember when taking care of your coffee is this:
Coffee is in its healthiest form in the cherry, on the tree. Each step in processing and preparing is, in essence, destroying the bean.
1b) Hulling, Wet Processing, Drying
The more you can protect the bean in each of these stages, the better flavor you'll end up with.
1) Protect your coffee from drastic temperature fluctuations. If you MUST buy more coffee than you plan to use within 14 days, you can freeze the coffee ONCE. Once you're ready to begin using the coffee, keep it at a consistent temperature, between 45-75 degrees (F).
2) Some people will store coffee in their refrigerator's "crisper" drawer, which is acceptable, if you plan to use the coffee within 14 days.
3) No matter where you store the coffee, keep it away from oxygen and moisture! Air-tight containers, whether in or out of refrigeration.
4) Keep coffee out of direct sunlight. An opaque, airtight container will solve both of these last points!
5) As often as possible, grind your coffee within 15 minutes of brewing. Keep those aromas in the brew! Fresh, QUALITY grinding is the biggest improvement you can make to your brewed coffee!
One last thing that many people don't consider is this:
If you are drinking a dark-roast coffee, consider that the bean has already been through a lot. The longer/hotter roast has destroyed much of the chemical make-up of the coffee compared to a light-roast coffee.
The darker the roast:
the more careful you should be with temperature and humidity during storage;
the sooner you should drink the coffee;
the more freshly ground the coffee should be;
and the more careful you need to be with extraction/brewing.... But that last point is for another post.
Simply put, we love to tell people "Just buy what you need for the next week- we love seeing you more often, anyway!"