On the Flintstones, a small bird sits inside the light and turns it on every night before he goes to bed. In a modern streetlight, a small circuit replaces the bird and turns the light on when the amount of light falls below a certain threshold.
A common light-sensing component is the cadmium sulfide photo-resistor, also known as a CdS cell. A photo-resistor changes its resistance based on the amount of light that hits it. When a lot of light hits it, it has almost zero resistance -- it conducts electricity very well. When no light hits it, it has high resistance -- it conducts electricity poorly. In an extremely simple circuit, you would wire a CdS cell directly to a relay (see How Relays Work), so that a lot of light would energize the electromagnet and a small amount of light would not. Usually, however, a CdS cell cannot draw enough current to activate the relay when light hits it. Therefore you need to add a transistor to amplify the current that flows through the CdS cell. A typical circuit might look like this:
If a small amount of current flows from emitter to base, then a large amount of current can flow from emitter to collector. In other words, if the base is grounded, it turns the "switch" (the path from emitter to collector) on in this diagram. So when light shines on the photocell, it turns the transistor on, which energizes the relay's electromagnet, which turns the light off. When it is dark, the photocell has high resistance, so no current flows through the base and the relay is not activated -- the light is on.
In a real street light the circuit might be a bit more advanced, but not a lot. It has the CdS cell, the transistor and the relay, but might need more than one transistor depending on the size of the relay. It really is a very simple circuit!
Here are three useful links: