That depends on the material of the lens. Plastic lenses won't protect your eyes. But you can add UV protective coating to your plastic lenses if you want. Glass lenses can protect your eyes from UVB rays but not UVA rays. So you still need to add UV protective coating to your glass lenses when you are exposed to the sun with glass eyeglasses on. Because UVA rays can result in long-term damage to your eyes.
regular glasses can't protect your eyes from the sun. So you need to wear sunglasses to protect your eyes from harmful UV rays. However, polycarbonate lenses have built-in UV protection in its lenses, so glasses with polycarbonate lenses can protect your eyes from the sun.