Try a lubricant first. That's your first line of defense. Of course, squeaky hinges could be a sign that the door is getting older, or perhaps out of alignment. When a door is not hanging plumb or square, it tends to squeak. But you would know this because it would be hard to open and close your door.
So I would recommend that you try WD40-or any lubricant spray for that matter. Open and close the door a few times right after you spray, and it should be nice and quiet.
Just remember never to use WD40 on a window, however. That's because WD40 is an oil-based lubricant and it attracts dust and debris, gets stuck in the window frames and is hard to clean out. Whereas on a door hinge, the WD40 will be absorbed into the pin, where the squeaking is actually happening.
If you don't want to use a petroleum-based product, use a silicone, or even a food grade silicone spray, which you can find in any department store.