The potentiometer represents an LDR. When the light in your room turns off, your LDR will increase its resistance, which will raise the non-inverting voltage. When the non-inverting voltage is greater than or equal to the inverting voltage, the light will turn on. You can adjust the voltage divider to increase or decrease your reference voltage, but don't go too low, otherwise your LED will always be on.