Without full make and model I can only guess at a possible answer.
If your machine is fitted with any belt and pulley drives or clutches it could possibly be a failing bearing somewhere in the system. I could be very worn and when hot will squeel then seize stalling the engine. Once cooled down the bearing is freeing off enough to turn again.
Robin S, August 2008