Ok so, this has been asked before, and I did not understand until I actually needed one.
The answer is: "If you're very careful, never" The perhaps slightly more realistic answer is: "When you're too hot to jump"
When out exploring stuff happens, you slip into a gravity well accidentally, either from not braking or scooping too close, whatever.
When this happens you will not be operating at standard temperatures.
As a for instance for my 'gotcha' I realized how close I could get to a black hole out of supercruise, and wanted to play with the lensing effect and take pictures, so I did, what I did not realize is that when near a black hole (or other bodies) and out of SC, your operating temperature gets pretty high and then levels off. Now all of this is dependent on your baseline operating temperature as Kloothufter said, a cool running ship wont rise as high.
There are however instances where even if youre at a safe operating temperature close to the star/planet/whatever, it will be high enough that if you engage your FSD, it will increase to dangerous levels and damage your modules. In these situations a heat sink can allow you to jump out of the gravity well without damaging your ship.