Generally the most common problems with these engines is fuel-related, though ignition can be a problem if the blade has struck something shearing the key.
Typically this is caused by a bad seat safety switch.
Its out of gas
Mine was doing the same thing, and it turned out one of the plugs was not firing, which turned to be not the plug but the coil for that side (Briggs & Stratton 18hp on an MTD 1650 lawn tractor)
this question is to broad we need more information. b]But most likely if it stalls after running it could be your fuel pump going bad
The kill-switdh wire is disconnected. loose. or broken. The kill-switch wire starts from the OFF position of the ignition switch and meets another wire that leads to GOUND to stop the engine.
Possible fuel filter, fuel pump sock fuel pump, Ignition module are the tops off the top of my head.
An engine usually has a higher idle speed when the ac is running. If the high speed idle does not operate then the ac will cause the engine to stall.
Removing the oil cap with the engine running causes a vacuum leak in the positive crankcase ventilation. This causes too much air to enter the cylinders at once, which results in a stalling engine.
A 1998 Honda Accord could stall because it is out of gas. The car could also stall because of a bad computer.
sensor or belt
sensor or belt
It means the engine stopped running.