This computer appears to be 7 years old with a 2009 release date. There are several things that can cause this. If you make the changes that neemo suggests it may fix the problem if it's minor. However, if you are using a wireless keyboard and/or mouse or combo unit (1 transmitter/receiver dongle for both), you should temporarily replace with a hardwired usb keyboard and usb mouse and retest for the not coming out of sleep problem. If the problem abates, you most likely have a faulty wireless keyboard/mouse or both and they need to be replaced.
We see this problem a lot on older computers, as people never get rid of their keyboards or mice until the buttons break on them or their dog chews them up or something.
These components don't last forever especially if you have kids or pets in your home that can abuse them. Another simple thing to try if you do have a wireless keyboard or mouse is to remove all the batteries from both units, and replace them with brand new Duracell batteries fresh from the package. If the problem abates, you had faulty batteries.
For some reason, my customers many of whom are on fixed income hate spending money on new batteries, even if they are years old. Just like a car battery, those don't last forever either, and if you try to start your car one morning and it doesn't turnover, and you haven't replaced your battery in like 7 years or so (the age of your computer), there's a pretty good chance your battery is shot--if you don't replace it your car won't start.
Neither will your PC work correctly if you are using wireless devices with poor or dead batteries!
Try these simple fixes we suggest; in the majority of cases, this will take care of your problem.
If the problem persists, you'll need to take your computer to your local Computer Pro and pay him to fix it for you. If you can't afford to do that or just want to DIY, take a look at my detailed troubleshooting guide here:
Windows 10 - Unclickable Task Bar.
Best of luck to you,
<<<BIGBEARJEDI>>>