There are a number of adjustments that can be made to door hinges to fix doors that don't close properly. The correct adjustment naturally depends upon the problem you're trying to solve, but in general, there are three common adjustments.
Shims can be placed beneath the hinge leaf to move the door further from the hinge side of the jamb. The most common shim material for this purpose is a business card.
The hinge mortise can be deepened to move the door further from the strike side of the jamb. This is limited to fairly small adjustments, unless you are willing to plane down the edge of the door.
The hinges can be moved fore and aft in their mortises to correct for a warped door. Moving the hinge further into the mortise obviously requires recutting the mortise; it's better to move the opposing hinge out.
Close the door, and check the reveal (the gap between the door and the jamb). To move the door closer to the hinge side of the jamb, deepen the hinge mortise. If the gap is too great on the strike side (too tight on the hinge side), shim the hinge by unscrewing the hinge and placing shims underneath.
Doors that bind on the doorstop may be corrected by moving the hinges in their mortises. Move the hinge slightly out of the mortise, drill new pilot holes for the hinge screws and reattach the hinge. Note that it may be easier to reset the door stop than to move the hinges.
A door that isn't set plumb may swing open or closed by itself. Usually the amount of shimming necessary to correct this problem is excessive and creates binding on the strike side of the jamb. A simpler alternative is to bend the hinge pin; this provides extra friction to keep the door from moving on its own. Lay the hinge pin on an solid, flat surface (a concrete floor works well), and strike it midway on its length to impart a slight bend.