What is GDP?
GDP or Gross Domestic Product is the market value of all final goods and services produced within the borders of a country in a given period. There are 3 approaches to calculate GDP, the most well known being the expenditure method, i.e: measure all expenditures (spending) in the economy: For spending to occur on a product, obviously it has to be produced. Thus by measuring total spending we can measure total output or production. See wiki for additional info.
GDP = C + G + I + (X - M)
C: Personal consumption expenditures: Total consumer spending on final goods and services. Makes up the lion share of US GDP at 71% in 2009
G: Government consumption expenditures and gross investment: Total government spending on final goods and services. Transfer payments such as social security and unemployment are not counted in G. A social security check is spend by the consumer who receives it, so it falls under C. Makes up about 20% of US GDP.
I: Gross private domestic investment: Mostly business investment in physical capital (eg: software, factories, equipment). Financial investment is never counted, as that is saving  . Also includes new residential housing purchases, and changes in private business inventories. Makes up about 12% of US GDP in 2009, typically though it is closer to 16% during normal economic times.
X: Exports are good/services produced domestically but not consumed domestically. They must be added to get a true account of domestic production.
M: Imports are goods/services not produced domestically but consumed domestically. They are already included in C, G or I, so it must be subtracted from GDP. Since the US runs a trade deficit (X-M) is negative and thus takes away from GDP at -3%.
GDP as gross domestic income
GDP is also total gross domestic income, as one's spending is someone else's income. If you buy an IPod from Apple, that money isn't lit on fire. It is income for Apple's employees, management, investors, suppliers etc:. Not only are you a consumer, you are a producer. Your income comes from your role in the production of a good or service. In other words the spending of another entity on that particular product results in your income. And this is true for all income earners. Thus all spending in the economy is also all income generated in the economy.
As a simple illustration, let us look at an economy with just 2 people. Let us say Jim hunts fish, and Alice farms potatoes. During the year Jim "produces" 100 fish and sells them to Alice for $5 each. Alice "produces" 200 potatoes and sells them to Jim for $2 each. The total GDP for the year in this economy is 100 X 5 + 200 X 2 = $900. The total gross income made by Jim is $500, by Alice $400, for a total of $900. Of course the gross income minus spending is much smaller or negative in the case of Alice. But the point is the Alice's spending is Jim's gross income and vice versa. The same is true in real world economies. The spending of consumers, business and government is income for other business and consumers. See pages 2-5 here (pdf) for an excellent explanation, from the US Dept. of Commerce.
1. Consumption of fixed capital (economic depreciation) is included, as both GDI and GDP are gross figures. Depreciation is essentially accounting for the portion of physical capital that wears out during a given period. For Net Domestic Income (NDI) and Net Domestic Product (NDP) depreciation is subtracted.
2. Note that transfer payments such as social security income and welfare payments are not included in GDI. Given that they are transfers, this would result in double counting. Only incomes generated from the production of goods and services are included.
3. In economics saving is defined as not spending (deferred consumption). By default any income made is saved, that is until it is spent. Putting your money under a mattress, in a bank account or financial investment is all considered saving, as all these activities takes money out of the real economy. Now if money leaves financial institutions through other channels it may result in spending in the real economy, unless it is saved again.
4. Let us take stocks as an example to illustrate the saving concept. Buying stock is a transfer of claims on future production, not actual production. Which is why financial investment is never counted in GDP, as GDP is measure of production. Vast majority of stock purchases are third party transfers. If you buy IBM stock, you purchase it from a third party who already owns the stock, not IBM. Money never leaves the financial system. Only on an new share issue does IBM get any financial capital. But even this is not counted in GDP, as IBM may choose to retain this money or buy financial products, both of which are saving. Only when that money is actually spend in the real economy does it count towards GDP.