OHMs law my friend.
A LED is a diode, so it will have a voltage drop, blue tends to have the highest from what I have experienced, but this can range between 2-4V depending on the LED, so I only ever work with a few voltages, 12V, 5V, 3.3V and occasionaly 1.8V, I know that for 12V I use a 1K OHM resistor, for 5V I use a 300-330R resistor (depending on what I have to hand) and so on.
This works along the line of a white LED has a forward drop of 2.2V for example, which means that for a 12V supply the voltage is approximately 9.8, I like to drive my LED's at 10mA, just because I feel they are bright enough, with OHMs law in mind, 9.8V / 10mA (0.010) = 980R, closest is 1K, for 20mA, use a 500R resistor or something of close value. with no or high resistance the LED will pull far too much for it to handle and burn out.