There is an LED calculator:
http://led.linear1.org/1led.wiz
Plus some of the links there explain the theory.
Given that Ohm's Law is: V = I * R
To calculate R you need: R = V / I
An LED will have around a 2V forward voltage drop (see the datasheet for exact figures) so you need to drop 3V (5V - 2V) if you are plugging into an Arduino output pin.
Generally you might want 20 mA (0.020 amps) to light the LED. So substituting you get:
R = (5 - 2) / 0.020 = 150 ohms