remove stones (if any) from the base of the fireplace.
carefully scrub all metal surfaces with fine steel wool. This includes
the base, gas tubes, metal log holder(s),pilot holder and any other
metal parts that are near the pilot.
then clean all scrubbed surfaces with a damp cloth.
replace stones but do not place any stones under the gas tubes, or
within 6" of the pilot and thermocouple.
The fireplace is likely turning off because the thermocouple is
overheating- thus turning off the pilot light. The heat generated in
the fireplace needs to dissipate, but the dirt and oxide build-up on
the metal surfaces act as an insulator.
Your fireplace may require such a cleaning every month to keep it