Pilot lights are often designed so that the heat from the flame holds a bimetallic switch in the open position. Should the light go out, the bimetallic switch will shut as it cools.
For water heaters and wall furnaces with a gas control valve, yes. For old stoves, they don't.
For water heaters and wall furnaces with a gas control valve, yes. For old stoves, they don't.