It is either flooding out or over heating and shutting off. When it does this pull the spark plug to see if it wet.
You can also pull the muffler and slowly crank the engine over with the plug out and tell us what you see.
We want to know what the piston and cylinder wall looks like. They should both be smooth with no vertical scoring or rubbing marks. You should also see a light coat of oil on the piston when moving it up and down.