Hi my name isXXXXX would like to assist you with your question. I am an expert here on JustAnswer.com in the computer field. How are you doing today?
There are a couple of things that can cause this type of issue.
In my experience the two things that will cause this are
1) Overheating issue (I would recommend if you do not have a cooling pad to purchase one) avoid setting the laptop on a cloth surface, it may be getting too much heat.
Also I would recommend turning it off and blowing out the inside for dust.
What's the model number of the laptop?