From About.com http://coffeetea.about.com/
Should you freeze or just refrigerate your coffee? Store it in jars, paper or plastic bags? Does it matter if it's whole bean coffee or ground coffee? These are the questions that plague most coffee buyers.
Well the answers vary, depending on what form your coffee is in.
Green beans store the best. If they are stored in a cool location, in a tightly sealed container, they can last over a year. Even after all that time, they will still produce a flavourful and aromatic cup. The problem with green beans is that there is a lot more work involved to turn them into a cup of coffee. You'll have to roast them and then grind them. This may be undesirable for an average coffee drinker. Green beans can be harder to find too. Quality coffee shops may sell them, but grocery stores usually don't.
So, the next best way to store coffee is to store in roasted but whole bean form. Grinding your own beans is pretty simple, and will be worth the effort. Roasted whole bean will last 1 to 2 weeks, when stored at room temperature. You should keep it in an airtight container that blocks the light. Plastic or metal containers may contaminate the taste of your coffee, so try to use ceramic if possible. If you must use clear glass, then store in a dark cupboard.
One other thing to consider is gas. Roasted beans create a lot of gas (carbon dioxide to be specific). For the first few days, you should open up your coffee container each day to vent out extra gas. Another alternative is to use valve bags. They have little one-way valves in them to allow CO2 to escape but don't allow oxygen in. The downfall is that these bags can be pricey, and hard to find.
If you can't use up your whole bean coffee in 2 weeks, then you should freeze it. Coffee stored this way will last about a month, maybe two. Wrap it up in several layers of plastic wrap, or use an airtight container with as much air removed as you can manage. Once your beans have been frozen and thawed, do not refreeze. You don't even have to thaw them out before grinding. Frozen beans will grind up just fine.
Don't try to compromise by storing in the fridge. That is the worst place for your coffee. It's just not cold enough to prevent your coffee from going stale. With all the other foods in your fridge, your coffee is likely to pick up flavors and odors too. That's just not good.
The last kind of coffee would be roasted and ground. This is the most volatile form, and isn't good for storage beyond a few days. Again, use an air-tight and light-proof container. Don't bother trying to freeze ground coffee. With all that extra surface area, it's going to go stale anyway.
The bottom line is that good coffee is fresh coffee. Only buy what you can use up quickly.