MOSFET overheating in pwm control
Just for conduction losses, the power dissipation in the MOSFET could typically be \$I^2 \cdot R_{ds(on)}\$ or about 5.4W at Tj = 120°C, assuming 4.5V drive, which your 5V micro should be providing. At only 500Hz the switching losses should not be too bad even with a 100R gate resistor, but they can still add. 

You need a fairly large heat sink or a fan to dissipate this amount of heat. Without a heat sink it will quickly overheat and destroy itself.



Edit: As Will Dean pointed out in a comment below, you can tell you've got a problem by looking at the thermal resistance junction-to-ambient (that's with no heat sink) from the datasheet. 



The temperature rise above ambient would be 5.4W times 62 or 334°C, so in excess of 350°C with a 25°C ambient. That's way above the absolute maximum junction temperature rating, and the part will fail at some before it gets there.  



If you already have a large heat sink, I would suspect that D1 is not doing its job. You do not give the part number, but it will have to dissipate quite a bit of power as well, so a Schottky diode is desirable.