|The five continental associations representing the world's Olympic Nations. Gold: Pan-American Sports Organization; Green: European Olympic Committees; Black: Olympic Council of Asia; Red: Oceania National Olympic Committees; Blue: Association of National Olympic Committees of Africa; Gray: non-member country or territory. Map by Evan Centanni, modified from public domain wiki map (source), and modeled after this Wikipedia map.|
How many countries participate in the Olympics?
There are currently 204 recognized Olympic Nations, represented by a National Olympic Committee (NOC) in each country. The games are presided over by the International Olympic Committee (IOC), and the NOCs are divided among five continental associations (see map above). 
If 204 countries sounds like too many, don't worry, you're not going crazy. Indeed, the U.N. only recognizes 194 sovereign states in the world (see also: How Many Countries Are There in the World?). So what gives? Well, it turns out that the IOC has historically been more lax than the U.N. about the criteria for nationhood. Before 1995, some dependent territories were allowed to qualify for the Olympics, and were allowed to stay even after the rules changed. Today, there are ten such territories with Olympic Nation status:
|Click to enlarge: Dependent territories and partially recognized sovereign states admitted to the Olympics. By Evan Centanni, from public domain base map (source).|
British Virgin Islands (U.K.)
Cayman Islands (U.K.)
Puerto Rico (U.S.)
Virgin Islands (U.S.)
Hong Kong (China)
American Samoa (U.S.)
Cook Islands (New Zealand)
Besides those exceptions, qualifying as a nation usually requires recognition as a sovereign state by the U.N. However, in 1995 disputed Palestine was admitted for the sake of athletes in Gaza and the West Bank, the two semi-autonomous Palestinian Territories which are largely cut off from the main territory of Israel. And Taiwan, which is claimed by China but effectively ruled as an independent country by the pre-Communist Republic of China government, has also been allowed to participate....but only as long as it refers to itself as "Chinese Taipei". 
Changes to the roster
In the last Summer Olympics in Beijing (2008), there were three new Olympic Nations: the Marshall Islands, Montenegro, and Tuvalu. But since then, no new countries have joined. In fact, one has been removed: the Netherlands Antilles, a Dutch dependency in the Caribbean, was ruled ineligible by the IOC last year after the territory was officially dissolved.
|Location of the former Netherlands Antilles. Public domain map (source).|
Which countries aren't included in the Olympics?
Despite the inclusive and worldwide mission of the Olympic Games, not all of the world's states are represented. In fact, two U.N.-recognized countries still haven't joined: newly independent South Sudan has not yet formed an NOC, though one of its athletes has been accepted to compete under the Olympic flag this time; and U.N. observer state Vatican City, which perhaps doesn't consider itself a "nation" (since it serves only as the headquarters of the Catholic Church) has never applied.
In addition, the ten dependent territories allowed to participate in the Olympics are only a select few, leaving most of the world's overseas dependencies without their own teams (though athletes from the territories may attempt to qualify for their patron country's team). And partially recognized or unrecognized states are not usually admitted, even if they are effectively independent. In fact, there are a number of National Olympic Committees which have been created locally but not recognized by the IOC:
|Click to enlarge: Territories and sovereign states not represented in the Olympics. Light Blue: No NOC; Dark Blue: NOC not recognized by IOC. Also shown in dark blue outlines: subnational regions with unrecognized NOCs. By Evan Centanni, from public domain map (source).|
Somaliland (unrecognized sovereign state)
Anguilla (U.K. territory)
Montserrat (U.K. territory)
Turks & Caicos (U.K. territory)
Iraqi Kurdistan (autonomous region in Iraq)
Macau (Special Administrative Region of China) 
Abkhazia (partially recognized sovereign state)
Catalonia (region of Spain)
Gibraltar (U.K. territory)
Kosovo (partially recognized sovereign state)
Northern Cyprus (partially recognized sovereign state)
French Polynesia (French territory)
New Caledonia (French territory)
Niue (free associate state of New Zealand)
Northern Mariana Islands (U.S. territory)
Which countries are attending the London 2012 Olympics?
It's not uncommon for a few countries to miss the Olympic Games in a given year - a small country fails to field a team, a big country boycotts, or tropical countries skip the Winter Olympics - but the London 2012 games are special. This year, all 204 recognized Olympic Nations will be attending the games, resulting in one of the biggest international sports events in history. Wikipedia has a full list of the participating nations, complete with links to the rosters for each national team.
|Number of athletes sent to the London 2012 Olympics by each participating country. Map by Foreston/Wikipedia (source). License: CC BY-SA|
Now that you know the background on the Parade of Nations, you can watch the London 2012 opening ceremony and games with a new understanding of the political geography behind the sporting event - if you have any questions, post a comment or shoot me an e-mail!
Further info: 2012 Parade of Nations - ordered list of countries and flagbearers (Wikipedia)
 The five associations correspond closely to conventional definitions of the continents, but with a few quirks: Turkey, the Caucasus, and Israel are part of the European association despite being geographically in Asia; and the South American territory of French Guiana also falls under European jurisdiction, because it is considered an integral part of France and does not have a separate team.
 "Chinese Taipei" is intended to be ambiguous, since most Taiwanese people consider themselves to be at least culturally Chinese. However, the use of "Taipei" is somewhat unfortunate for the two-thirds of Taiwan's people who do not live in or near Taipei City. This was especially awkward when the 2009 World Games (an Olympics-related event) were held in Kaohsiung, Taiwan - something of a rival city to Taipei.
 Although Macau's NOC is not recognized by the IOC itself, it has in fact been accepted as a member of the relevant continental organization, the Olympic Council of Asia. Macau has participated in the Paralympic Games but not in the regular Olympics.