I get this problem fairly often. It's particularly anooying when I goto bed, and just press the monitor power, then my computer's power, assuming it will turn off, finding out in the morning that most of my apps have been terminated, but it's still running :/
The best thing you can do, is make sure you have nothing running before you turn off. If it persists, look at what's running (ctrl+alt+del) and kill processes under your user name (not SYSTEM processes or you may crash or end up with an unusable system) until you find out the culprit.
I have a suspiciion that the culprit for me, may be something that shows a dialogue box asking if you really want to quit.
Hope this helps, anyway.
PS. I don't really recommend it, but if you really need to turn your computer off, you can just hold the power button for a few seconds, but I guess you arelady know this.