Is the Fuel fresh? It also might be a carburetor problem. This is when it is not delivering enough fuel for the engine to keep running. Try opening up the adjustment screws a little and see if that makes a difference.
How to Adjust the Carburetor:
"Adjust your carburetor if the engine cuts out when idling or at high speed. Look for a two small screws on your weed trimmer carburetor that has a slot for a flat head screwdriver. One screw will be marked H, for high speed, while the other will be marked L, for low speed. The high screw will adjust the fuel mixture given when the trimmer is running at its highest speed, and the low screw will control fuel mixture for the idle speed. To adjust the L screw, start the weed trimmer and turn the screw counter clockwise until the speed of the engine decreases. Do this again clockwise. Remember these two points and position the screw so that it is somewhere between the two extremes. Adjust the H screw the same way. This will ensure that the fuel mixture of the engine is correct so that excess air or excess fuel will not cause the engine to cut out."
Bad\dirty carburetor or not getting gas.
dd
Its out of gas
get a new engine DUMMY!
lack of fuel
check ignition
to me it sounds like your map sensor is going out, you might want to check that.
weak fuel pump.
you can but it wont stay running if the battery is dead
dirty carb bowl or water in the carb
check for a vehicle theft system?? Is the Light Illuminated. does it stay on:::
Have you checked the alternator?