I own a RPi 3 Model B, which does a very good job of freezing of its own accord, even when not much activity is being done.
I mean, I can still move the mouse, but it stays in its last frame and I can't click anything, which forces me to cut the power, which, wastes time.
I haven't put in any code or commands to start this problem, nor have I changed any settings that might affect this (I only update the appearance settings), and even then, my Pi still freezes.
Even when everything looks normal on the actual board.
Oh, and, unlike other questions which have the entire RPi frozen, I can still move the mouse cursor.
I'm also using LXDE 0.9.3 with Stretch repos.
And, I also really don't think this has to do with the GPIO pins because I don't have anything in them!
Even though this might be irrelevant,the only external devices plugged into the Raspberry Pi is a Logitech MX500, a Lenovo keyboard I don't really know about, a Viewsonic VX2640w monitor, and a pair of Labtec speakers I don't really know about either. I'm using the power supply that came out of the box: plugged in through the MircoUSB power supply with an input of 100-240 volts and output of 5.25 volts; 0.45 amps for input and 0.2400 milliamps for output.
In case this might also help, my RPi is known to freeze any time: on an unsaved chromium project, on an unsaved code project, in the middle of a download, right when I'm launching an application, etc.