You don't say how old it is, but assuming electronic ignition, you probably have a duff coil. Replacement with a known good unit is the only diagnosis possible here, beyond checking that the problem isn't a intermttent safety switch or simlar. Check this by disconnetng the 'kill' wire at the engine. If it now runs for longer, there's your problem.
phil_saunders@bigfoot.com
Phil Saunders, September 2008