Backgrounds and emoticons for a particular game on Steam are all worth the same number of gems, as are its cards. What determines how many gems a game's community items and cards are worth?
I'm not entirely sure, but part of the equation is not hard to figure out. Every game is assigned a value in gems that game is "worth". How exactly that value is determined is the unclear part, but I'm pretty the rest works like this. To determine the gem value of a game's backgrounds and emoticons take the determined value of the game and divide it by 2. To determine the gem value of that game's trading cards divide the game's worth by the number trading cards in the complete the set.
Since trading in a complete set of cards for a game gives you a background and a emoticon in return this means that the gem value of the items traded in is the same as the items received in return. At the moment I believe you also get a Winter 2014 Holiday Sale trading card for crafting a badge like this, so you actually gain gem value through the trade, but after the auction and sale is over this will no longer be the case.
I can only say a few things with certainty about how a game's gem value is determined. The first is that free-to-play games all seem to all have been assigned a worth of 200 gems. The winter and summer holiday sales, which while not actually being games have also been valued at 200 gems. Most other games have a value of 160 gems. The exceptions have lower values, and there seems to be a correlation with how "cheap" the game is, though it's not a perfect one. There are some apparently cheap games with high gems values, and some not-so cheap games with low gem values.
Since correlation doesn't prove causation, it could easily be something not directly related to the price of the game (whether current, initial or some sort of average price) that determines what games are worth. It might have something to do with how many trading cards are outstanding for that game, cards that have accumulated in people's inventories were they get ignored. How often the items are traded or badges crafted could be the determining factor. An important selling point for a number of cheap games has been the fact that you can recoup a significant portion of the cost of the game by selling the trading cards you get, so cheapness might be a proxy for the presumably more active markets for these games.