could be one of many things if it happens when the engine is hot..
Simple tests to narrow it down.
ride it again untill it fails, then pull the spark plug spark plugs and place them on the engine (or any good earthing point), turn motor over, do you have spark?
if no spark, its an electrical issue
change plugs and retest,
test coil resistance, or simply replace the coil as they are cheap from wreckers/ebay
if its an injected quad ensure the ambient air temp sensor isnt getting hot (due to bad positioning, our benelli 1130 had this issue!)
many many things it could be, but you need to look at this as a process of eminiation starting with the most likely and easiest things to test for.
if you do have a spark and its still strong and visable it is mostlikely not an electrical problem
check fuel pump
check fuel lines (kinking when the get hot (softening hose)