Hello Sandra, my name is George.
The cause of this is 'no signal getting to the valves from the thermocouple'
Near to each burner you can see a white candle and a pointed object.. The pointed object is the thermocouple.. When that heats, it sends a small charge to a solenoid at the rear of the valve to keep the gas-line open.. If it fails to send the charge then the solenoid remains closed, so when you release the button the gas-line closes again.
You need to have the themocouples checked for secure eathing and operation, then if found to be faulty, have them replaced