Image: Couple looking at computer © Corbis

It sounds like a cruel joke.

After a lifetime in the work force, you call it quits at 62 to claim Social Security benefits and begin a long and satisfying retirement.

Then, the worst economic calamity since the Great Depression hits with the vengeance of Hurricane Katrina, decimating your nest egg and depleting the value of your home. Faced with the painful reality that you must go back to work, you count yourself lucky to find a job at a time of high unemployment.

And your reward? The federal government suspends your Social Security benefits.

Say hello to the confusing and controversial Social Security earnings test. This provision of the law says sure, you can claim your benefits as early as age 62, but you can't necessarily keep the cash if you work before reaching your normal retirement age (66 for workers born in 1943 through 1954).

The earnings test cost a quarter of a million working Social Security beneficiaries about $100 million each month in 2009, according to a ballpark estimate Social Security officials made for Kiplinger.

No one knows how much of that figure is a result of retirees being forced by deteriorating finances to go back to work. But it's clear that anyone who claims Social Security benefits early -- or who's thinking about it -- needs to understand what's going on here.

And that includes the increasing number of 62-plus men and women who have lost their jobs and, as they've struggled to find new ones, have filed for Social Security early to pay the bills until they can restart their paychecks. There's been a big jump in the number of Americans claiming benefits early since the recession began driving unemployment higher.

How the earnings test works

If you apply for Social Security benefits early, you'll be asked whether you plan to keep working and, if so, how much you expect to earn -- to determine whether you'll be stung by the earnings test.

For 2012, the test applies if you make more than $14,640. And for every $2 you earn over that limit, you'll lose $1 of benefits. Suppose you claim benefits at age 62 and your monthly benefit is $1,500 (and you estimate that you'll earn $30,000 during the year). Because $30,000 is $15,360 over the limit, you would lose half of the excess, or $7,680, in benefits.

The Social Security Administration doesn't trim each check by a proportional amount. Your benefits are withheld completely until the squeeze is satisfied. In this example, you'd get no benefits for five months (covering $7,500 of the lost benefits), and your benefit in the sixth month would be $1,500 minus the final $180 claimed by the earnings test, or $1,320.

In the year you first claim benefits, the test basically lets you ignore money you made before you applied and squeezes benefits based on monthly earnings for the rest of the year. In the calendar year you reach normal retirement age, a more lenient earnings test applies: You lose $1 for every $3 in earnings over $38,880 before your birthday. Starting in the month you reach normal retirement age, there's no earnings test. You can earn as much as you want without losing a dime in benefits.

Note: For purposes of the earnings test, only wages from a job or self-employment income count. Investment earnings, pension benefits, money drawn from an individual retirement account or 401k, or even lottery winnings do not.

More from Kiplinger's Personal Finance magazine: