Continue to Hold the pilot button down for approx 20-30 seconds after you light it. If it goes out after that make sure the thermocouple is snug 5/16" wrench, light run a wire brush over the pilot hood. If it doesn't fix it. Replace thermocouple. If that doesn't cure it, time for a gas valve.
Home Depot sell universal 24 or 36 inch tcouples for less than 15 bucks.

