(a) There are two reasons, and both count.
First, aluminium does not react with cold or hot water at all. Like zinc and iron, it reacts with water only when steam is passed over the heated metal:
2Al(s)+3H2O(g)→Al2O3(s)+3H2(g)
Second, aluminium reacts with the oxygen of the air at once, forming a thin layer of aluminium oxide over the whole surface. This layer is hard, sticks tightly to the metal and protects it from further attack. So the hot water never touches aluminium metal; it touches aluminium oxide, which does not react with it.
(b) Aluminium oxide is amphoteric: it reacts with bases as well as with acids. Sodium hydroxide therefore dissolves the protective oxide layer:
Al2O3+2NaOH→2NaAlO2+H2O
Once the layer has gone, the bare metal is exposed and the alkali attacks the aluminium itself, which is what pits the surface:
2Al+2NaOH+2H2O→2NaAlO2+3H2
The gas is hydrogen.

Basic, amphoteric and acidic oxides compared.