McGee writes: "Capsaicin appears to accumulate in the fruit concurrently with the pigment during ripening".
(On Food and Cooking, p.212)
So yes, chilis get hotter as they ripen (that is, as they turn from green to red).
Many chili varieties are picked and sold in stores while still unripe and green (e.g. jalapeño, serrano, poblano), but you will occasionally see ripe, red ones in stores.
All of the dried chilis I've seen in stores have been completely ripened before drying (e.g. chipotles, which are smoked, dried red jalapeños and anchos, which are dried, red poblano peppers).
I've personally observed this effect with padron peppers, which are usually picked green and mild, but can ripen to red, hot peppers if left on the plant.
cooking.stackexchange.com/users/5263/Steve
I know this is an old post, but had to reply.
I grew jalapenos this year, and the heat difference between green and fully-ripened red is astounding.
The green jalapenos had a very, well, green flavor like that of a green bell pepper, but with a mild heat.
After reading a lot of posts around the web, that almost all seem to say that peppers get "smoother" as they ripen, I interpreted that as meaning that the heat wouldn't increase.
My interpretation was faulty!
The red, ripened pepper was many, many times hotter than the green.
I wasn't expecting that burst of flavor when I popped a slice of pepper in my mouth to experience the "smoothness" of the ripe pepper!
I can't tell you the science behind it, but I can verify that, at least in my garden and with my jalapenos, the ripe peppers are far hotter than the green.
cooking.stackexchange.com/users/26950/Toni
Not really.
The chemical that gives chillies their heat is called capsaicin .
It is an extremely stable alkaloid, and so remains potent even after a long period of time:
note, for example that dried chillies and even chilli flakes are still hot.
cooking.stackexchange.com/users/4194/ElendilTheTall
Most chiles become more picante as they ripen.
But they also become much sweeter.
Jalapenos are a good example.
Red jalapenos are much more delicious than green ones.
Most of the 'heat' is in the seeds and the tissue connecting the seeds to the capsule.
You can pare those parts out with a small knife.
I eat most of my ripe jalapenos right in the garden, pocket knife in hand!
cooking.stackexchange.com/users/15047/Eric Logan
I have traveled the world seeking hot peppers here is what serious farmers have helped me to understand.
Mother nature uses animals to spread seeds.
If you notice most peppers have two strategies to make sure animals don't eat the fruits before the seeds are mature.
First one when the pods are immature the peppers are well camouflaged (blends in with the srems or leaves) and as they start getting larger and more noticable they get very hot so as to deter animals from eating them until the seeds are ready to be distributed in the animals "poop".
Just prior to maturity the placenta is larger and the hottest.
Very quickly now the pods change color and become noticable and sweeter to attract the distributors but the placenta membranes start shrinking and the "hot" concentrates briefly.
At this moment when they are changing color is the best if you want the heat.
A couple of days can make a huge difference in heat and either bitterness or "sweetness", just understand this is not a "sweetness" as in sugar or honey but a reduction in bitterness.
cooking.stackexchange.com/users/41015/Roger
According to my next door neighbour, a chilli farmer, heat isn't determined by colour, but by how long you leave them on the bush.
cooking.stackexchange.com/users/54206/Chef Pauly C
This answer might vary between types of chillies, but I'm curious to know when they're hottest.
Are chillies hotter when they're ripe?
cooking.stackexchange.com
<chili-peppers>
cooking.stackexchange.com/questions/23604
cooking.stackexchange.com/users/2271/gak
Chilis do tend to get hotter as they ripen on the bush and change colour, but most of the heat is in the seeds and membrane. Chilis do get hotter as they ripen.
Chilis get hotter as the ripen.  The heat of chilis depends on the time is stays on the plant, not on the colour.