The harmful sun light is the ultra violet, a radiation with wavelength shorter that 400 nanometres (nm). Ordinary glass block 90% of the radiation with shorter-than-300nm wavelength, but allows for more than 90% of the longer-than-350nm-wavelength radiation to pass through.
Since the harmful radiation is especially that with wavelength of under 315nm, ordinary glass does give some protection, although not a complete one. It is clear, however, that sitting at home behind a glass window exposes you to much less risk of suffering the negative effects of ultra-violet radiation.