06 800 x2 spitting and sputtering

So I have an 06 sportman 800 x2. It will run fine for about 30 min then it will start to spit and sputter then quits running. I will let it sit for about 30 min and it will start but then quits running again after about 10 min of riding. It runs longer if it is cold outside but eventually does the same thing. Any help would be appreciated