When you cook chili it releases capsaicin which is due to the cooking process extracting the capsaicin from the chili pepper.
So the chili pepper and the chili does get somewhat hotter the longer you cook it but only up to a point because there's only so much capsaicin that can be extracted and released from the chili pepper.
Once that capsaicin is released it can no longer release anymore so it cannot get the chili any hotter than it already has no matter how long you cook it.
But cooking chili up to a point does make it get hotter.