Yes, possibly hardware.
The standard test for RAM is memtest86+. Run it for 6 or 8 passes, which might take overnight.
For hard drives, use the drive manufacturer's testing tool, downloadable from the manufacturer's web site in the support area.
Get memtest86+ here and burn it to a disk and boot from it.
Memtest86+ - Advanced Memory Diagnostic Tool
Have you taken a look at processes or RAM usage in Task Manager or Resource Monitor during the times that the PC is lagging??
Some info about your hardware might help--CPU, hard drives, and RAM at least.