What's in discussion here is specific heat capacity. The flow of heat is based around temperature, and whilst that may seem like a fairly obvious statement, there are important distinctions to be made here.
It's commonly said that temperature flows from hot to cold. What this really means, is that heat energy flows from a higher temperature to a lower temperature. But again, why the distinction between heat and temperature?
Well, because the two are not the same, they are intrinsically linked, but they are not the same. The heat energy stored by an object varies due to the material of the object. This is why people go surfing in the autumn - water takes more energy to raise its temperature than the surrounding areas, so even when the air is cold, the water is still relatively warm, whereas in summer, it has yet to heat up.Our bodies are mostly water, raising the temperature of which requires far more energy than aluminium does (5 times as much has been stated in two previous answers - I thought it was closer to 6 times, but without Googling it, the point still stands).
The effect responsible for this is known as specific heat capacity, the amount of energy required to raise the temperature of a given mass of a given material by a certain amount:
As confusing symbols goes, this formula does pretty well. Rather than $θ$ being an angle, it is the change in temperature. $c$, rather than being the speed of light, is the specific heat capacity, and $E$ is sometimes written $Q$...
However, what this formula shows us, is that your aluminium foil, whilst it is as a high temperature, doesn't actually have much heat energy inside it, the $θ$ term may be high, but the $m$ and $c$ terms are both low.
This energy is then transferred to your hand over a period of time, until the two reach thermal equilibrium (same temperature, not same energy). As your hand absorbs energy, for every degree it increases in temperature, the foil will decrease 6 degrees.
Getting more pedantic now, but this will also not happen instantly (and technically, this is almost a diffusion process - sometimes modeled as the transfer of phonons of heat - and so can never be completed), so added to the fact that the foil has low mass (and thus low heat), and the fact that the heat distribution will prevent all of the heat going to your hand, and added to the fact that even if all the heat does go to your hand, your hand's greater value for $c$ will mean that the temperature change of your hand is far less than the temperature loss of the foil, the process will also not transfer all of the energy to reach equilibrium, and you would certainly have enough time to remove your hand (especially as, if you waited that long, the oven itself would begin to be heating your hand, and you might actually want to remove it).
Suffice it to say, you should feel pretty safe with your aluminium foil!
P.S. My general knowledge was wrong, it is about 5 times as much (slightly under, actually), basically replace all '6's with '5's.