OP --
We need some more info.
Is the 2012 MBP a retina model?
Or... is it a NON retina model? (this one has the DVD drive)
IF it's a non-retina, the following may apply:
The 2012-design non-retina MBP's have a "weak" internal ribbon cable (that connects the drive to the motherboard). What happens is the cable gets "frayed" and the internal wires either break or "short out" on the aluminum casing.
What this "looks like" to the user is that the drive (or OS) seems to be freezing or locking up, or not responding at all. This sounds EXACTLY like the problem you're seeing.
The solution is to replace the cable.
It's not difficult, you can do it with a Phillips #00 driver and a plastic "spudger" tool.
Go to iFixit.com to see what's involved.
They'll also have the ribbon cable part number -- you can either buy it from them, or from online.
Apple USED TO HAVE a FREE replacement program for these cables, but that's probably ended by now.
IF you have a brick-n-mortar Apple Store reasonably close, you could take it them and have them do the replacement.
ONE MORE THING:
Again, IF it's a non-retina MBP, and if it came with a platter-based HDD inside, you could swap out the HDD for a low-cost SSD while you have the back off.
A drive swap will require a TORX T-6 driver to take the little bosses off the side of the HDD and then re-install them to the SSD.
This is a simple process, anyone can do it.
If I could do it, YOU can do it.
Just get the cheapest SSD you can find in the size you need.
I'd also suggest a USB3/SATA adapter/dongle. With this, you can "prep and test" the new SSD BEFORE you install it, to be sure it's working as intended.