without specific details it's really difficult to determine the cause.
If you PC is old then probably the cpu fan isn't providing sufficient cooling.
main causes are dust, thermalpaste or fan itself has aged.
a new fan with a new heatsink might cost you some 10$
download RealTemp and get some cpu temperatures, maybe the cpu overheats and restarts.
come back with more info so me or other can help you.