I'll assume this question is about men looking at uncovered women; rulings for women looking at uncovered women are different.
Basically it boils down to the ayah:
Tell the believing men to reduce [some] of their vision and guard their private parts. That is purer for them. Indeed, Allah is Acquainted with what they do.
(Which is reinforced by ahadith such as Sahih al-Bukhari 5066: Whoever among you can marry, should marry, because it helps him lower his gaze and guard his modesty.)
It's one of the steps men can take to guard their chastity. AskImam describes this verse as a command of Allāh Ta‘āla for men to lower their gazes from non-Mahram women. It's normally considered obligatory for a man to lower their gaze in front of non-mahram women:
If your eyes fell on a non-Mahram woman, you have to avert your eyes from her. It is impermissible for you to look at the faces of non-Mahram women intentionally, even if it is without lust.
There's exceptions regarding e.g., the first glance at a woman, and for old women (AskImam), and when considering a woman for marriage (IslamWeb). There's also some slight differences of opinion:
It is Haraam for one to gaze at a non-Mahram woman with desire and Makrooh Tahreemi (severely disliked) to do so if there is no desire.
Different Muslim men implement this in various ways and with various level of success.