Light and excessive heat can damage the flavor and stability of your finished beer. They cause a variety of off-flavors and will also prematurely age your beer.
Light
We’ll begin with light since it is the simplest to address. Direct sunlight creates a specific off-flavor known appropriately as “skunky beer.” The skunky flavor and smell come from a compound known as 3-methylbut-2-ene-1-thiol, or MBT for short. This MBT “skunky” odor has a very low flavor detection threshold—as low as a few parts per trillion.
All modern beers contain hops with alpha acids that become isomerized during the boil and provide bitterness to the beer. If you expose these alpha acids to UV-B light from the sun, they will combine with sulfur in the beer from the malt and give a lovely MBT compound and aroma. In direct summer sunlight, the reaction can happen in just a few minutes!
To counteract skunky beer, many commercial brewers use dark-colored bottles to reduce exposure to UV light or cans to eliminate it. While a few beers “embrace the skunk” as part of their flavor complexity, most beer drinkers find it unappealing.
Heat
And now for the subject of excessive heat (well above room temperature). Beer itself is made of thousands of flavoring compounds, all of which change character over time due to slow chemical reactions that occur as the beer ages. Applying heat to your finished beer has the net effect of accelerating many of those chemical processes. In fact, breweries perform accelerated aging tests on their beer by heating them up to a high temperature (say 140°F/60°C) for a few days.
So the short answer is that heating your beer will result in premature aging. That being said, I don’t recommend heating up your barleywine or old ale to 140°F/60°C to accelerate the aging, as the effects are really not identical to properly aging your beer. A rule of thumb often quoted is that an 18°F (10°C) rise in temperature doubles the rate of aging.
As far as specific effects from heating your beer go, you will tend to lose hops flavor quickly, which will emphasize the deeper, rounder, caramel, malty side of the beer. This is usually the most notable difference in a beer aged hot if you were to taste it side by side with a cold-stored one. However, with enough heat and time, the malt will also lose its edge and become quite bland and dull.
If you have even a small amount of oxygen in the finished beer (as almost all homebrewed beers do), you can end up with accelerated oxidation. Heated light-colored beer can take on slightly oxidized “stale beer” flavors, which can include cardboard/paper/lipstick flavors you may have experienced drinking from an oxidized pony keg at college. Darker beers tend to take on a wine-like, almond, or sherry-like flavor, but often at the expense of their more malty notes.
The color of your beer will tend to darken slightly with heat and age due to melanoidins in the beer. Excessive heat can also cause proteins to coagulate in the beer, which—in extreme cases—can show up in the foam and also create clarity issues.
Most beers reach their flavor peak early in the life cycle, so it is usually best to cold age and cold store your beers if possible. Room temperature storage is fine if you have limited space in the fridge. I personally try to avoid storing my beer in hot places, such as the garage, in the summer, though a few hours in a hot car is certainly not the end of the world.