Simple darkness sensor with ldr
Remember that the resistance of the LDR decreases as the light level increases, so in bright light the LDR allows current to flow into the base and causes the transistor to conduct.

You need to swap the LDR and the base resistor. Connect the fixed resistor between the base and 9V; connect the LDR between the base and ground. In bright light the LDR will shunt all of the base current to ground, keeping the LED off. In the dark, the LDR will have a high resistance allowing current to flow through the fixed resistor into the transistor's base, causing it to conduct current.