Until the Wrath of the Lich King came out there were four types of gems (red, yellow, blue and meta) that fit into sockets on your weapons. Putting a gem into a socket enhances your gear in some way. Note that once you put a gem into a socket, it is there forever. It's superglued in place, so to speak. It cannot be removed although you can put another gem on top, which will destroy the first gem. So be certain before you act. You don't want to make a costly mistake. Here is what Blizzard says about gems and gemming gear. By the way, The Solo MMO Player says most gems go on gear, not weapons. I find that an interesting choice on Blizzard's part.
After the Wrath of the Lich King expansion the gem system expanded into three primary gems (red, blue, yellow), three secondary gems (purple, green, orange), and then the meta gems which seem to be rare or epic. Blizzard says in the basic gem info link above that you can put any gem anywhere except for meta gems that will only go into meta sockets, but there are special bonuses if you color match, so probably you want to do this when possible. A secondary (such as orange) gem can go into two different sockets (red or yellow). Along the same lines a purple gem can go into a red or blue socket and a green gem can go into a yellow or blue socket. Doing this color matching of gem to socket keeps to The Plan and might award you secondary bonuses. Of course you may not care about these bonuses, depending on how your character is set up.
WOW Wiki talks about what the gems mean and how they work here. It's confusing but at least they break down the gem types so that you know which ones are available in which area.
Those who are jewelcrafters can buy epic gem cutting patterns using Dalaran Jewelcrafter's tokens. You can't buy the patterns with gold, and this has been heavily criticized (see second link below). Raw gem material is gotten by mining titanium ore and by alchemy transformations or bought through honor or Emblems of Heroism.
Apparently there are a lot of folks not happy with the state of jewelcrafting after the Lich King changes. You can read a good critique of the current system (Patch 3.2 Call of the Crusade) here.
RESEARCHING GEMS
The WOW Gem Finder looks like a useful little tool as you can search for abilities or colors, and everything links to WOWhead so you can look up more information on their extensive database once you know what you are looking for. It is not up to date however. It doesn't include the changes in the gemming system that the Wrath of the Lich King expansion brought to the game.
There is a list of gems broken down into four categories of red, blue, yellow and meta on the Allakhazam site (it is not up to date either). Click on a category and a list of all those type gems opens with the effect shown. This isn't searchable and I don't think it is nearly as useful as the WOW Gem Finder but here it is for you to use if you like.
RECOMMENDATIONS
I've found several articles recommending certain gems for various classes. I can't judge just how useful these are but they are here in case you play one of the classes I found information on.
Death Knights (PvE only)
Hunters (enchantment recommendations here also)
Restoration Druids
http://www.rollinghots.com/ 2009/06/29/jewel-studded- resto-gems-in-patch-3-2/
http://4haelz.blogspot.com/2009/09/gemming-your-resto-druid.html
Rogues
http://samueltempus.wordpress.com/2009/09/03/gems-for-your-rogue/
http://4haelz.blogspot.com/2009/09/gemming-your-resto-druid.html
Rogues
http://samueltempus.wordpress.com/2009/09/03/gems-for-your-rogue/
Shamans (enchantment recommendations here also)
FIGURING IT OUT ON YOUR OWN
What you have to do is look at your own specs and gear and decide what you need, then research where you might find such items. This is a top-down approach. You could also just look up info about gems you get in drops in raids you plan to run, or can make, and decide how best to use them. This is more a bottom-up approach. Solo players probably need to do both things as they don't have a guild bank that has gems one can take and are probably not raiding except through PUGs.
This two year old article may be of some help.
Here is an example of figuring out socket bonuses. It's really just applying a bit of math to the gems that enhance areas you want to optimize.
***************************
Copyright Solo MMO Player at http://solommo.blogspot.com