Pilot light on gas log fireplace extinguishes when turn gas control knob to "on"
Once you light the pilot hold it there for up to a minute then turn to on.
It is possible the thermal pile or thermocouple is not quite hot enough.
I find giving it a minute usually works if it still goes out and the flame is hitting the probe of the TC it is time for a new one.
The good thing is they are inexpensive and easy to change.