It's to space the capacitor up off the board so that undue stress is not placed on the ends of the capacitor (for example, if the lead spacing in the board holes is not exactly the same as the lead spacing on that particular capacitor, or if the thermal coefficient of expansion is different from that of the PCB).
As well as your pictured film capacitors, you'll find similar kinks in ceramic disc capacitor, thermistors, MOVs and similar parts.
Here you can see it clearly called a "hold off" kink on a disc capacitor.

Some other parts- NTC (Negative Temperature Coefficient) thermistors:

The capacitors you pictured are epoxy dipped, but the early laquer dipped ones were even more susceptible to damage from too much force on the leads. This should bring back some bad memories for oldsters here:
