I am presuming the video doesn't freeze in the live preview in the OBS window?
1. In settings go to output.
If your Recording Quality is set to 'same as Streaming' then set streaming encoder to Hardware NVENC. Else Set the recording encoder to Harware NVENC.
Try another recording, this should offload the encoding to the GPU and reduce issues.
Also consider where you are recording to, could the hard drive be the bottle kneck, consider using your system activity monitor to view whether the CPU, GPU, Memory, or Hard Drive might be at high utilisation by more than just OBS.