What could be the reason that this transistor gets too hot unexpectedly?
How to know if you need a heatsink. (Apart from the burnt finger).
This is well covered in engineering textbooks and courses. And websites such as this.
In short :
You know the power dissipation, and the ambient temperature where this lives. Let's say, 1W, and 40C.
You decide what temperature you want to restrict the junction to : below 100C, lets say 90C for a safety margin.
From the Junction-Case thermal resistance (10C/W) and the power (1W), that gives a case temp of 80C (or 40C above ambient).
Which means we need 40C/watt between case and air.
(If the 62K/W figure is correct for a SOT32 package ... google it ... you need a heatsink.
So we look for a heatsink with 40C/watt or better, thermal resistance.
(This is slightly simplified to illustrate the principle, but good enough for this application. For more detailed thermal budgeting, see e.g. the website above)
Damage can take microseconds to years, depending on the degree of overheating.
I have never seen any package get remotely close to 10K/W without a heatsink. It's usually more like 62K/W, even for a large package. Smaller packages like SOICs can be double that, and SOTs can be four times that and it doesn't really change all that much with more exposed metal surfaces. You have to mount heatsinks to make use of those surfaces.
You have to read the subscripts and fine-print in the datasheet. 10K/W is the junction-to-case thermal resistance and is used in heatsink calculations. Junction-to-ambient is what is important if you are not using a heatsink.
How much easier life would be if we could get numbers as low as 10K/W junction-to-ambient.
The 10°C/W in your datasheet is from the junction to the case. For a transistor sitting in the air with no heat-sink, the thermal resistance from case to ambient will usually be much higher than the thermal resistance from junction to case.
Unfortunately the data sheet for your particular transistor does not talk about the thermal resistance from junction to ambient, or from case to ambient but picking another transistor in the same case style ( http://www.farnell.com/datasheets/43630.pdf ) suggests the junction to ambient thermal resistance will be about 100°C/W
So if your ambient temperature is 30°C and you are dissipating 1W, then the junction temperature would be expected to be about 130°C and the case temperature about 120°C
Which is pretty hot, but it's within then 150°C maximum junction temperature rating of your transistor.
P.S. Even with a heat-sink it is generally impractical to actually achieve the nominal rating of a transistor. With your transistor achieving the nominal rating requires a case temperature of 25°C which is wildly impractical.