The dimming of cabin lights only happens when it is dusk, dawn or dark outside the aircraft. This is a safety measure, and is to ensure your eyes are adjusted to the gloom enough to see the floor lights leading you to safety along the aisle in the event of a crash or emergency evacuation.