Ultraviolet light has a wavelength shorter than that of visible light in the range between approximately 400 nm and 10 nm. The wavelength of UVA is 400-315nm and the wavelength of UVB is 315-280nm. Overexposure to UVB radiation can cause sunburn/some forms of skin cancer. The most deadly form, malignant melanoma, is mostly caused by indirect DNA damage from UVA radiation.So ability of the sunglasses to protect you from the UV type is what you asked in the question. Most preferably UVA protection is relevant as most of UVB gets filtered as it passes through the ozone layer.
The sun has the ability to damage more than just a person's skin. Studies have shown that the sun's UVA and UVB rays can also cause damage to different parts of the eye and affect vision over time. Both UVA and UVB are beyond the visible spectrum, which means that they can't be seen with the naked eye. UVA is made up of longer wavelengths, and some experts disagree as to whether these light rays are damaging to the eyes. UVB light, however, is the most damaging and the main reason why people need to protect their eyes and skin while outdoors. Since results are inconclusive, it is safest to protect one's eyes against both UVA and UVB radiation.