If it happens both when you start from a stop and when you skid, then it's most likely that the cog is slipping. Get a chainwhip and a lockring tool and give it a good tightening. It's a good idea to do this once in a while if skidding/locking up the rear is your main method of stopping.