Social security does indeed look at the amount of money a disabled person earns. Specifically, if you can engage in what the Social Security Administration (SSA) calls "substantial gainful activity" (SGA), they won't be eligible for benefits. A person who earns more than a certain monthly amount is considered to be engaging in SGA. Federal regulations use the national average wage index to set the income limit for determining the SGA each year. In 2017, the amount is $1,170 for disabled applicants and $1,950 for blind applicants.
Individuals who work and earn gross monthly income exceeding the SGA threshold are not considered disabled and are ineligible to receive benefits, unless they were working under special circumstances. Generally, if you are making over $1,170 when you apply, your claim will be denied almost immediately, without a medical review (your medical records will not even be requested or evaluated because you will be considered ineligible for benefits), because how much you are earning is one of the first things the SSA looks at.
Now, if your friend has stopped working and then applies, it doesn't matter, because SGA rules apply only where a person is receiving SSDI and working. What your friend would have to show - if he was earning consistently above $1170 a month -is that his condition worsened to the point where he had no choice but to stop working and apply for disability. That's the basis for a person filing a disability claim in the first place, though.
There are other rules and special circumstances that are a bit more complex, for example, where a person collects SSDI and then goes back to work and makes more than SGA, the Social Security Administration will not automatically cut off benefits, and may consider this instead a "trial work period" where a person wants to see if they are well enough to return to work.