An inspection of the fan fixture will usually reveal four wires, each with a distinctive color. The white and green wires are for the neutral and ground wires, respectively, and are common to both the fan and the lights. The other two wires are hot, meaning they carry the charge from the power source. Although the colors of these wires may vary from manufacturer to manufacturer, the usual convention is that black is for the fan and red is for the lights. Check the installation instructions for the fixture to verify the wire color coding for the model you have.
The normal procedure is to wire a ceiling fan to a wall switch so you can control it like a light fixture. To do this, you need to run a length of electrical cable between the switch and the fan. Twelve-gauge cable is preferable to thinner 14-gauge cable, but it depends on the size of the cable running between the switch and the power source. The electrical code forbids changing the wire size in the middle of a circuit. Moreover, you may need a cable with two hot conductors instead of just one, depending on the wiring configuration.
You can wire a ceiling fan to a single switch that will control both the lights and the fan at the same time, or you can wire them to separate switches. In the former case, use a 3-strand cable with a single hot wire, twist the leads from the light and fan to the hot wire, and connect the hot wire to the switch. In the latter case, you need a 4-strand cable with an extra hot wire. Connect the fan lead to one hot wire and the lights to the other, and run the hot wires to separate switches.
If you want to control either the fan or the lights with a pull chain, the power to that component must always be on, and you have to bypass the switch. You'll need to use a 4-strand cable, and connect the lead for the lights to one hot wire and that for the fan to the other. Run the cable to the switch, and connect the unswitched component directly to the hot wire from the power source. The easiest way to do this is to attach it to the same terminal on the switch to where you attach the hot circuit wire.