I have a 7 years old laptop in better condition but there is a problem with their mouse.

Mouse does not work properly. after 2 times restarting the system then mouse works but after few time approx. 10 to 20 min or when right clicking then mouse stop working.

The usual is try another mouse. Those pads do stop working and some call those mouse for some reason. I no longer try to fix touchpads. Lessons learned.

Does it matter which USB port you plug it into?

Is it a wired mouse, or a wireless mouse?

If it's a wireless mouse, are the batteries fully charged?

Do you have any problems with any other USB devices?

Have you run any diagnostics?