Sockets can be used to place stat altering gems into your gear. The higher level gem, the more of a bonus it will grant you. Additionally, these gems will all contribute toward a total "color rating", which maxes out at 300. At 100, 200, and 280 color, you will unlock increasingly extravagant wings that allow your character to show off his power. These wings are cosmetic, and don't give you any statistical bonus.
To embed a gem, visit the Blacksmith in freedom harbor. Select the embed option, and the gem and gear you want to combine. Place both items in the window, and then select "ok". The gem will socket in, and you will gain any benefits from the gem at that point.