These are not lights, they are the Eye Reference Indicators. They are used to find the correct seating position. You adjust your seat such that the white ball is exactly hidden behind the red ball on your side:
Since the A300 Airbus has provided an eye reference indicator on the centre structure of the windshield in all Airbus aircraft (fig.3). It enables flight crew to adjust their seat position so that their eyes position matches the eye reference point. The indicator is a device that is fitted with 3 balls painted red or white. To achieve a correct seating position, pilots must align the red and white ball meaning that the white ball is hidden when in the correct position.
(Airbus - Are You Properly Seated?)
This YouTube video shows how to properly adjust your seat on the A320 (you can see the eye reference indicators at around 1:30): CORRECT COCKPIT SEAT POSITION! Eye-Position-Indicator explained by "CAPTAIN" Joe
They are not unique to Airbus though, some other aircraft have them too, like e.g. the ATR-72 (left) or the Dash-8 Q400 (right):
(image source: theflyingengineer.com)
Boeing uses a different method for seat adjustment, so you won't find such indicators there.