1) My guess is the thermocouple (silvery tube about 3/16" diameter and 2" long that sticks up into the pilot flame, with a copper or shiny metal tube leading back to the gas control valve unit. If the thermocouple is not kept hot by the pilot light, it shuts of the gas flow as a safetuy measure so gas cannot build in the house from an unlit pilot light to ignite the flame. My first guess is it is too old (should be replaced annually at annual cleaning), or it may be corroded or not sticking in the pilot flame like it should - about 1/4 of length at the tip should be in the pilot flame, so it stays hot. It is held in place by spring fingers in the screw-in holder - can be slid up and down, though may require removing it to do so.
2) If the pilot flame is not blue but is yellow or flickering severely, it may not be keeping the thermocouple hot enough, so when the draft changes as the gas burner goes off, the thermocouple cools enough to shut off the gas. If there is rust against it brush that away while the flame is off - may be blocking pilot flame.
3) Another possibility, though remote since it stays lit by itself OK, is it is making bad contact at the gas control valve - it screws into the gas control valve unit (make sure you are on the small thermocouple line, not the larger pilot light gas tube) - gently (do NOT pull hard on it) check with a wrench to ensure it is seated all the way in its hole, so the end is touching bottom.
here is a article on adjusting the pilot and thermocouple -
You can find others with more pictures by googling - thermocouple flame adjustment
4) It is remotely possible there is a problem in the gas valve, but that is the last place to look- about $250-350 to replace, and generally cannot be repaired - only replaced.
If you have not solved the issue that way, call a plumber - probably about $10-20 parts and minimum service call charge - about $80-150. If it has not been cleaned recently, ask for that too - little additional charge if any, because the minimum service charge (1/2 hour call rate) will probably cover that. If your furnace has not beed cleaned and thermocouple changed in the last year or so I would get that done at the same time if you can, to save on service call charges.