One of a few things could be causing this issue. I would check to see if you have spark as soon as it dies. That will let you know right off the bat what you're dealing with. If it dies and won't start back up, and you do not have spark the ignition coil is going to be the problem. Replace it.
If you do have spark and it still won't start, just turn the key off and on several times and see if you can hear a "click" sound down at the carburetor. If the fuel shutoff solenoid is failing that can also cause that problem. If you cannot hear the solenoid clicking, put your hand on it and see if you can feel it clicking (sometimes they're quiet). If you cannot hear it or feel like clicking as you turn the key off and on you'll need to check to make sure the solenoid has voltage coming to it. There will be either a single red wire going to the device or a black and grey. To check the voltage you'll need a test light or a volt meter. If it has the single red wire, check between that red wire and ground with the key turned to the "run" position. If it has the black and grey wires, have key in run position and check for voltage between the black and grey wires. Whatever voltage is on your battery should also be on the wire(s) at the solenoid device. It may be a little less than battery voltage, but not much.
Having said all that about the fuel shutoff solenoid, I highly doubt that will be your problem. Normally it either works or it don't.
The ignition coil, on the other hand, can come and go to some extent and I really feel like that's where your problem will be found.