There are two causes for this issue:
The driver is not installed correctly. Go to Start > Run > devmgmt.msc and locate the device in the list. Right click it and select Update Driver. Make sure you are connected to Internet and let it update correctly.
There could be a hardware problem, therefore replacing the mouse is absolutely necessary.
Note: Input the mouse to another port if it's using USB.