Wiring a ceiling fan is surprisingly simple. Often times it is no more complicated than the wiring of a light fixture. As with any electrical wiring, make sure all wire connections are made securely with the proper size wire nuts, that they are not loose and that no copper strands are showing. Most “house wiring" should be 14 or 12 gauge solid copper wire attached to a 15 or 20 amp 120vAC circuit respectively. Consult a professional if you encounter something varying from this and are not aware of how to safely handle it.
Most commonly ceiling fans will have 4 wires, or 3 wires plus a ground. Black, white, green, and an additional color (usually red, blue, or black/white striped). The black wire is the hot lead for the fan motor. The red/blue/striped wire is the hot lead for the optional light kit. The white wire is the neutral lead for both the fan motor and light kit. The green wire is ground for the entire assembly.
In all cases the neutral (white) wire from the fan assembly should be attached to the neutral (usually white) lead from the house wiring. Note that if you encounter a white wire with a marking piece of colored tape attached, this could be used to signifiy it is being used as something other than a neutral.
The ground (green) wire or wires from the fan assembly should be attached to the ground (usually bare, sometimes green) lead from the house wiring. Some older houses may not have a separate ground lead and use the metal conduit and electrical boxes as ground. In this case you would attach the ground wire from the fan to the electrical box (and/or mounting plate) with the appropriate screw or clip.
The two remaining leads are the hot wires for the fan and it's light kit. If you have a fan with no light kit, connect the black wire to the hot lead (usually black) from your power supply. For a fan with a light kit you would connect both wires to the hot power supply lead, unless your house is wired to switch the fan and light independantly.
For more scenarios, and more detailed information and wiring instructions, see: http://www.ceiling-fans-n-more.com
This article created by Dan “Spiffy" Neuman. Read more of his great works at http://www.ceiling-fans-n-more.com