led cube question

Resistor value depends on Forward Voltage Rating (Vf) of the LED and how much current you want to flow.
Vf changes with color - red can be as low as 2V, blue & green higher, up to 3.6V.
Ohms law determines the value. Voltage (V)/current (I) = resistance (R), so V=IR
(Vsource - Vf)/current = resistance
Driving from Red LEDs from Arduino pins at LED maximum current?
(5V - 2V)/20mA = 150 ohm

Green/Blue?
(5-3.3)/.02 = 85 ohm

Power dissipated by resistors: Power = Current * Voltage, and V=IR
so power dissipated can be P=IIR.
20mA * 20mA * 150 = .06W, or 60mW.
1/8W or 1/4W resistors will be fine.