WBE is being so polite
As stated above, start by RTFM, in this case at a bare minimum the pinned post in this forum
OBS Studio creates a log file each time you run it which contains very useful diagnostic information. Without a log file, it's much harder for any support volunteers to figure out problems and your post may be ignored. To upload a log file, go to the Help menu > Log Files > Upload Last Log...
obsproject.com
The fact that your games runs fine is irrelevant. Any recording software will have to, on top of everything else your PC is doing, perform real-time video encoding which is VERY computationally demanding. So, do you have a PC up to the task of both your game AND real-time encoding?.. in your case, with your OS and OBS settings and whatever else you are running on your computer .. the answer appears to be a 'No, not reliably'. That doesn't mean its OBS' fault, or any equivalent software could do any different.
One alternative might be to use a very limited capability software optimized for encoding offload to a GPU with a dedicated encoding chip. Yes, OBS can do the GPU encode offload as well, but also has lots of other, CPU demanding, options, so the onus in on you, if you have an under-powered system, is to learn the options and implications of those options and adjust accordingly. There are many discussions in this forum on just this.
I recommend monitoring hardware resource (CPU, GPU, RAM, Disk I/O, etc) utilization [for ex. using Task manager’s Performance tab and/or Resource Monitor] to see if your system is being maxed out with your settings
https://obsproject.com/wiki/General-Performance-and-Encoding-Issues and
https://obsproject.com/wiki/GPU-overload-issues
And for a quick automated review of your OBS log [not your PC as a whole, which could just as easily be the problem], try See what the Log-Analyzer says to your log file:
OBS (Open Broadcaster Software) is free and open source software for video recording and live streaming. Stream to Twitch, YouTube and many other providers or record your own videos with high quality H264 / AAC encoding.
obsproject.com