The L7805 got hot when connected to ATMega8?
there is about 7 volts difference between the input and the output of the voltage regulator. At least a 2-4 volts difference is recommended and also both the micro-controller and the led draw current enough current to heat up the regulator provided the voltage drop. Linear Voltage regulator are not so efficient.

you can try any of these to deal with the heat

1.try placing a 100 ohm resistor(1 watt) in series between the +12 volt terminal and input of the voltage regulator to limit some current to the voltage regulator. This may heat up the resistor though but its okay. You can completely ignore heat sink since the regulator will barely get warm.  


try reducing the input voltage to 9 volts. This will reduce the voltage difference between the input and output of the voltage regulator. power dissipation will drop leading to less heating of the regulator. 
or you can use a DC-DC buck converter which is much more efficient than linear voltage regulator. Like this
https://www.amazon.com/MakerHawk-Converter-Efficiency-Regulator-Adjustable/dp/B07F3S5ZDX/ref=sr_1_17?crid=11HDKBHVFZAOQ&amp;keywords=buck+converter&amp;qid=1563946855&amp;s=gateway&amp;sprefix=buck+conver%2Caps%2C394&amp;sr=8-17