The 7805 is a series-pass linear regulator, which means that it acts like a variable resistor to drop the input voltage down to 5Vdc. If you input is 12V and the load is 1A, the power the regulator dissipates is:
P = I x V = 1A x (12V - 5V) = 7W
7W is a lot. You can maybe dissipate 100mW in a package without using a heat sink, but above that, you should be considering using one.
Look on the data sheet for design information. You want to keep the junction temperature well below the maximum rating, say at least 25degC below. The data sheet gives two thermal performance parameters. The thermal resistance Junction (to) Air is the thermal resistance if the package is *not* mounted to a heat sink but is in free air. 65degC/W is pretty high. The thermal resistance Junction (to) case (65degC/W) is the value to use when it is mounted to a heat sink.
In the first case, if you tried to dissipate 7W, the junction would rise above ambient air temperature bye this amount:
7W x 65degC/W = 455degC
If ambient is at 20degC, then the package would rise to:
455+20=475degC
The package is rated for a maximum of 125degC, so this condition would be instant death, except for on-chip thermal limiting that would shut down the regulator to protect it.
If instead you coupled it to a perfect (infinite) heat sink, the operating temperature would be:
7W x 5deg/W + 20degC = 55degC
That's do-able and acceptable.
That should give you the general idea of how to go about it. Most heat sinks aren't ideal, so they will have degC/W value to add to the 5degC/W (or they'll have an equivalent method).
Note that most of the parameters for the regulator are specified at 25degC. The closer you can run the regulator at room temperature, the better the performance will be.