I don't have a water heater with a pilot, mine uses a electric spark ignition, but I will try and share some of what I have read.
First when both the pilot and main flame light they should be a clean blue flame with no or little yellow. If it is yellow there is an adjustment for the air mixture to get a clean flame. The burner tube does need to be clean and free of "junk" like spider nests and webs. (Spiders love LP!)
Above the pilot and flame there is a "flame sensor" that detects that the flame is there. If it doesn't detect the heat of the flame the gas valve closes as a safety measure. Make sure that sensor is clean. It would seem that if it burns for 5 minutes the sensor should be good but sometimes a bad electrical connection doesn't show up until it gets warm.
Sometimes those older gas valves just get crankey and shut off for no good reason like the rest os us old fogeys....