A LED has a recommended current that you must use. If the current is too low then the LED will be dim. If the current is too high then the LED will burn out. A resistor is series with the LED will limit the current but it must be calculated correctly. The calculation is simple.
An LED with its series current-limiting resistor needs a supply voltage higher than the LED needs. The voltage required by an LED depends on its color. An infrared LED needs about 1.2V, a red LED needs about 1.8V and a white or blue LED requires about 3.3V. Add at least 1V for the resistor voltage.