It's baffling to me how much the role of HR is misunderstand and often misrepresented here. So here goes:
HR is not your friend, but they are not your enemy either. They are just doing their job as required by their role. They can be very useful if used in the right context
HR's primary job is to prevent the company from getting sued. They make sure clear company polices exist, that these policies and local labor laws are followed, and they manage cases where laws or policies are unclear or broken. In doing so they protect the company from exposure to bad PR, legal action, massive internal fights, etc.
It's not their primary job to make you happy, feel good, improve job satisfactions or give you back rubs; although most HR departments will engage in some "employee satisfaction" activities.
Once you you understand this, it's easy to decide when and how to engage HR. If anything that happens violates a policy or law, HR will indeed be your friend. Make sure that you have a really thorough and clean documentation of what exactly happened when, where, how, who, etc. The documentation needs to be fact based and emotion free. Then head over to HR and talk to someone face to face. Good documentation is a trigger point for HR since it is primary evidence that works great in court. This would cover things like discrimination, harassment, bullying, payments not issued or wrong, abusive behavior, etc.
If your problem is more related to the actual work: performance, tools, expectations, goals, management style, hours, etc. HR will stay out of it (unless it's so bad that it violates an existing policy). That's your manager's job, not theirs.
So to sum it up: you should definitely contact HR if there is suspicion and/or evidence that existing company policies and or laws are violated. Otherwise, you shouldn't.