Well I don't know much about fireplaces but since it is a gas appliance my first guess is a protective high limit switch opens and turns off the gas. That could be because the fireplace air flow is restricted somehow (in or out) or inside needs a cleaning. The other thing is does your fireplace have variable temp switch (like a thermostat for the fireplace)? Maybe it has reached the set temperature and is just shutting off.......but could be a bad fireplace thermostat perhaps? The other guess is a flaky flame sensor....so it starts but just fails soon after.
__________________
|