Benefits are based on your lifetime earnings. Your actual earnings are adjusted or “indexed” to account for changes in average wages since the year the earnings were received. Then Social Security calculates your average indexed monthly earnings during the 35 years in which you earned the most.
Social Security recipients below their full retirement age (66 for those born between 1943 and 1954) can earn up to $14,640 in 2012 (not including tax withholdings).
Source: US News, ssa.gov