Good morning, Atheda!
This could be a couple different things; the engine could be overheating causing the magneto to fail or it could also be an issue with the valves. I suggest you check the valves and make sure they are set to the proper clearance and that they are opening and closing.
Try that and let me know how it works!