This is a fairly common problem on push, self-propelled and riding lawn mowers. It can also be one that is hard to troubleshoot because there are several different things that can cause this problem in the first place.
You can check some easy things like the fuel cap for proper venting. If you take the cap off after the mower quits and you hear a whooshing of air, the cap is not venting as it should. Replace it with a new one or try to clean out the vent hole and see if that solves the problem.
The electrical portion is also another part that can cause your lawn mower to quit. The ignition coil, spark plug or associated wiring are all potential culprits.
It could also be the quantity of oil in a riding lawn mower. If the oil level is too low, if it is equipped with a low oil switch, it can shut down the engine to prevent any damage.
If you need professional help diagnosing your lawn mowers problem, visit our Locations page for a lawn mower repair shop near you.