Does the mouse/touchpad also stop? Is it a laptop, notebook, PC?... how do you get out... hard shutdown?
If it's only the keyboard cursor, it may be the driver... if both keyboard and mouse/touchpad cursors freeze, it could be a driver or someting else... OS or hardware related... Or failing PSU on a PC or battery/power converter on a portable computer.
Other possible causes are: If freezes are momentary, it could be Video Acceleration in the Display Settings. If the problem includes system instability and slowness, long boot times, etc: may be virus-malware infection. To help with any of these symptoms, apply my suggestions in the following thread.