Beer, just like most other food and drink products has a shelf life, as well as proper and improper way to store it. Where and how you choose to store your beer can make a huge difference in what it tastes like when you finally do crack that bottle or can open.
The quick answer to this question is you should either store your beer in the fridge, or in a cool, dark place like a closet or corner of your basement. The three enemies of beer are oxygen, heat and light. In general, you want to keep your beer away from all three of these whenever possible.
Here's a quick rundown of why:
There's a misconception out there that all beer needs to be kept in the fridge. While yes, if you want to drink it then you probably want it cold, you don't have to keep it in the fridge if that drinking isn't happening today.
You can keep a beer a room temperature for a week or two without it doing any real damage. While that can probably extend to a month, once your beer starts sitting around much longer than that the flavour is going to start to change in ways you're not going to like.
Ideally, you should store beer between 4-10°C. The warmer your storage is, the faster gross flavours will develop in it. And you never want to store a beer above room temperature. An afternoon in the heat can make quick (and not delicious) changes to the flavour of your beer.
That means don't leave beer in your boot in the summer while you spend the day shopping, or move its storage location to a spot in your house that gets hit with a ton of sun. Speaking of sun...
The same goes for light. Beer being exposed to sunlight (and fluorescent bulbs), even for short periods of time, can dramatically change its flavour, not for the better. Beer packaging helps with that (that's why your beer comes in dark bottles or cans), but that doesn't mean you shouldn't work keep it out of the sun's sight as much as possible.
Brown glass bottles are able to block 98 per cent of the damaging wavelengths from the sun. Green bottles only block 20 per cent of damaging rays and can become skunked in five minutes or less and clear bottles (obviously) block zero light and can become skunked in just a few minutes in the sun.
We all probably learned in primary school that if you leave a soft drink open overnight it's going to lose some of its carbonation. Besides just leaving a can open, oxygen can get into your beer when it's bottled or canned. Yes, breweries use machines that help eliminate a lot of that oxygen, but it's still going to be in there.
Oxygen getting in your beer can have a ton of negative effects. Namely, it can lead to a few "off-flavours", flavours in your beer that the brewers didn't intend to happen and that you don't want. Flavours associated with stale beer can include a waxy floor or mouthfeel, the flavour of cardboard or paper, and dulled hop flavour (for hoppy beers).
Most breweries will put a "best by" date on bottles to let you know when a beer's flavour is going to have changed to a point it's not how it intended for it to be consumed. If your beer doesn't have a date, presume it's going to be good for three months after it was bottled. In the vast majority of cases, you're absolutely not going to want to drink a beer that's over six months old.
When it comes to storing your beer, there's no huge tip here more than ensuring beers don't get lost in the back of your fridge and go out of date. Also, make sure there's not a "best by" date on the beer you're saving for later.
Over the years I've had dozens of friends save beers for years and years that were meant to drink immediately. Don't be that guy and miss out on great beer because you waited too long to drink it.