The fuel solenoid can cause this problem. There is usually a rubber cap on the end of the solenoid (Inside the carburetor) Remove the solenoid and then GENTLY pull on tis rubber cap and see if it comes off easily. DO NOT PULL HARD. If the tip comes off....for whatever reason, you MUST replace the fuel solenoid !
What usually happens is that this tip becomes soft and comes off of the solenoid while the engine is running. it then is sucked up into the carburetor jet port shutting off the major amount of fuel causing the engine to stall and/or not have enough power. Then when you turn the key back off, the metal pin of the solenoid then pushes back up into the rubber cap and it connects itself back in place until the next time the engine is started and the process is started all over again.
IF this is the case, you must replace the solenoid.
You can actually test this by taking the rubber cap off the solenoid and then putting it back in the carburetor. the solenoid will then be deactivated but the engine will run correctly...the only problem with testing it like this is that if the rubber cap has come off, then you must replace the solenoid anyway. so why bother. Just get the new solenoid.
Also another possibility is that the carburetor needs to be cleaned and rebuilt with a COMPLETE carburetor repair kit.
As engines sit or get older, fuel that is left in the carburetor can turn to gum and varnish and cause this and other problems. Also, any gasoline that was left in a gas can for a period of more than 30 days must be discarded because it also has begun to turn to varnish.
Today's gasoline's contain MTBE and alcohol. (Ethanol) They turn to "Junk and garbage" very quickly. Alcohol is partially water (H2O). And they call it "Oxygenated fuels! It is the oxygen that breaks down the organic compounds in the fuel and turns the gas to "Garbage" (Gum and varnish) The fuels we had just a few years ago had no alcohol in it and would store for longer periods of time before going stale... and fuel stabilizers do almost nothing to prevent the fuel from going bad with the changes in today's fuels.
Do not buy gas from the "Discount" Stations. The discount stations get a reduced price on gas because they may be buying fuel that is nearly 30 days old already. You may be getting fuel that's nearly stale right from the pump when buying from a discount station. Purchase your fuel from the well-known stations such as Shell, BP, Sonoco, Phillips 66 etc.
More than 70% of all of our repairs in our lawn mower business are due to this same issue. You most likely have dirt, gum, varnish...etc in your carburetor plugging up the small passageways and jets in the carburetor.
The carburetor must be removed from the engine. Clean all parts with carburetor cleaner and blow out all the small holes and passageways with compressed air. Remove all of the non-metallic parts since the carburetor cleaner will cause them to be disfigured decompose and plug the carburetor as time goes on.
Wash the carburetor cleaner off of the metal parts by washing them in warm, soapy water then rinsing with clean water. Dry them by blowing it off with compressed air. Make sure that all the passageways are blown dry before reassembling.
Reassemble using a NEW carburetor rebuild kit.
DO NOT TRY TO REASSEMBLE WITHOUT USING A COMPLTE CARBURETOR KIT! You will just end up having to do the job again.
ALWAYS clean the fuel tank and replace the fuel line when doing this repair or you may have to do it all over again. The inside of the fuel line disintegrates over time and these small pieces of rubber will plug up the carburetor too. Dirt and water from a dirty fuel tank will also plug up the carburetor. Find the Model, type and serial or code numbers off of the engine and take them to your local dealer to get the carburetor repair kit.
If you do the work yourself, take pictures or at least make a drawing of where all the linkages, gaskets, and component parts go. Correct reassembly is critical.
If the carburetor still doesn't work correctly, you may have to take it to someone who has an "Ultra-sonic" cleaning machine. This machine uses carb cleaner and ultrasonic vibrations to get the very small passageways clean when traditional methods fail.
If you don't feel comfortable with this kind of repair I would suggest sending it to a reputable shop.
Feel free to contact me here at this question anytime ...even after you hit the "ACCEPT" button ...and I will try to help further.
Please click "ACCEPT" or I won't get paid.
You may also consider sending a bonus if I have been helpful, Please leave POSITIVE feedback for me as this is how I'm rated. Remember, a neutral is nearly as bad as a negative. If not satisfied, contact me and I will make it right. Thanks