Did you perform a clean install of macOS after acquiring this used laptop? A clean install is when you erase the whole physical internal SSD (Intel Macs only) before reinstalling macOS. This provides you with a factory fresh OS leaving behind any possible file system issues, software issues, or configuration issues & modifications performed by the previous owner. In fact this is what the previous owner should have done prior to selling the Mac (even if the previous owner performed these steps, I still recommend the new owner perform a clean install of the OS just to be sure it was done properly):
What to do before you sell, give away, trade in, or recycle your Mac - Apple Support
The portion of the Kernel Panic you posted appears to show a failing GPU which is common with 15" models from 2008 to 2011, but can also affect laptops up to even 2015 models usually to a lesser extent. Of course some third party software may be installed which is causing these Kernel Panics. If you perform a clean install of macOS and you still get these GPU based Kernel Panics, then the laptop has a hardware issue which is not economical to repair as it requires replacing the Logic Board. FYI, you need to test the clean install before installing any third party apps and before restoring from a backup.
Also test the laptop with all external devices disconnected in case one of them is causing a problem. An external display or a dock are the most likely external items to trigger a GPU panic, but in reality any connected device could possibly cause it.
I would highly recommend returning this laptop for a full refund if possible since I am fairly certain it has a bad Logic Board.