You use Ohms law. First off, you look at the spec sheet for your LEDs. They will have a typical forward voltage drop @ a specified current (VFtyp). For a garden variety RED LED, that might be ~1.8V@20mA. It will be different for different color LEDs, and different type of LEDs
Three LEDs in series will drop three times as much as one would. So in this example, the forward drop of three RED LEDs would be ~5.4V. If you are starting with a 9V battery, you must have a series resistor between the battery and the LEDS to drop 9V to 5.4V, meaning that the drop across the resistor is 3.6V. (This is Kirchoff's voltage rule)
Also from the LED spec sheet, it specifies that the LEDs are designed to operate at some specified current, typically about 20mA. Note that this is a current that makes them reach their specified brightness; you can usually operated them at a much lower current and they will still be bright enough, thereby prolonging the life of the battery. Note that the forward drop of an LED doesn't change much if you reduce the current.
Finally, you now know that you need a resistor which drops 3.6V @ 20mA (or what ever current you want to operate the LED at). R=E/I = 3.6/0.02 = 180Ω.
One more thing: The power rating of the resistor needs to be checked. P=IE= 3.6*0.02 = 0.072W = 72mW, which means a 1/4W resistor is just fine...
Forgot to add: If you measure the drop across one LED, you should see about 1.8V, across two the drop would be 3.6V and across all three, 5.4V. Another example of Kirchoff's rule.