Why is LM 317 regulator getting hot?
The input is 33V and the output is 16V - the voltage across the LM317 is therefore 17 volts and the output current is 150mA. This means the power dissipated by the LM317 is 17 x 0.15 watts = 2.55 watts. You need a heatsink - read the data sheet and take note of what the temperature rise is per watt and realize that if the temperature rises much above 150 degC the output starts to shut down to protect itself.



Heatsink help using the T0-220FP package data from ST's data sheet: -

If you look in the device's data sheet it will tell you how many degrees in temperature the device's "internals" will warm per watt dissipated into the ambient surroundings. For instance the T0-220FP is 60degC/watt. You are dissipating nearly 3 watts so, without a heatsink, it will be internally (the junction) 180 degC warmer than your ambient local temperature but, of course, it "shuts down" well before 205 degC to protect itself. OK so far? This is the current situation without a heatsink.

There is also another figure called thermal resistance (junction-to-case) and this is 5 degC/watt. If you had an "infinite" heatsink, you would find that the junction (inside the chip) would get only 15degC warmer than the outside world and life would be sweet.

But you can't have an infinite heatsink so you find one like this: -



From Farnell here. You read the spec and it tells you that its thermal resistance is 21 degC/watt.

Next you add the 5 degC/watt to the 21 degC/watt to get the final thermal resistance, (junction to ambient) of 26 degC/watt. With 3W dissipated you have a temperature rise of 78 degC above ambient (say) 25 degC - this means the device will rise to about 103 degC. This heatsink might be OK but if your electronics is mounted in a box that is a little small, the local ambient may rise by 20 degC so you might have to take extra measures to sort out the extra rise.

I've just been reminded that the 60 degC/ watt (junction to ambient) below: -



... Is a parallel path to the junction/case + heatsink/ambient thermal resistance so this means the 26 degC/Watt figure falls to 18 degC/watt because parallel thermal resistance is calculated exactly the same way as regular parallel resistors in a circuit.

Alternatively drop the input voltage to 16 V using a buck regulator - it's about 90% to 95% power efficient and would therefore only dissipate about 200 mW but that's another question in case you want to follow that sensible route.