Goggles are typically used as protective eye gear. Alternatively, they can be used to jazz up whatever you decide to wear to your next rave.
Goggles have been used as a visual indicator of several different types of characters: Alchemists, mechanics, pilots, scientists (particularly mad scientists), snowboarders, or by characters in a Steampunk or post-apocalyptic wasteland setting. They can also be worn just to look cool. A growing number of games with character editors offer goggles as an eyewear or headwear option, regardless of setting.