Why use a 450 Ohm Resistor?
The LED light cannot handle the full voltage of a 9V battery. You add a resistor to lower the current flowing through to it to keep the light from burning out.
Example of what happens without a resistor.
This code allows it to light up in darker situation. Note that it is an ON/OFF function
This code allowed it to remain lit when surrounded by light.
Note that this is a dimmer function, allowing the amount of light to vary depending on how much light the sensor is receiving.
In a real world situation you could use these photo resistor sensor based circuits to maybe automatically turn on lights at certain times of the day where the sun goes down, for example street lamps. Or perhaps some lawn decorations or areas leading or lighting up a path.