Social Security determines whether you may be eligible for certain benefits--namely, retirement or disability insurance benefits--in part by whether you have enough "quarters of coverage," sometime also denoted "Social Security credits." For 2018, a worker earns one "quarter" or one "credit" for every $1,320 in gross earnings made during the calendar year. ($1,300 for 2017 and less for each preceding year). Regardless of how much you earn, you can only accumulate a maximum of four credits in one calendar year. The calculation for retirement benefits is easy. Generally, if you start working at 21 and do not have or acquire a disability, you will need 40 quarters/credits to be fully insured and thus eligible for retirement benefits at Social Security's minimum claiming age of 62.
If you work but have a disability though, the number of quarters/credits needed to qualify for Social Security Disability Insurance (SSDI) varies according to your age. If you are under age 24 when you file for disability, you only need 6 quarters/credits earned in the three years prior to the alleged onset of your disability. This scenario would fit you if you are a young adult with a disability who begins working part time. This could include work done through a school program as long as the student worker was on a regular payroll and had Social Security taxes deducted and paid from the earnings. Because it is the lowest possible threshold, some parents encourage their child with a disability to work enough to meet the six-in-three-before-24 target, Each year you wait to claim disability onset and to file, you need additional quarters to be eligible.
Of course, the amount of SSDI benefit paid would, under this scenario, be very small, since it is based on the earnings over time. In this, case, the earnings would be small and the time short. However, once you've qualified for disability benefits, you can continue to work. As long as you earn less than the $1,180/month that represents Substantial Gainful Activity (SGA) and you still have your diagnosis, you will still be considered to have a disability. You can continue to get your SSDI benefit AND add to your work history to increase your benefits.
Since SSDI is a benefit to which you are entitled because of the Social Security tax you have paid, your earnings below SGA do not reduce your SSDI. In addition, SSDI eligibility is not limited by your assets or by how much unearned income you may have from investments or other sources. This makes SSDI very different from SSI where you lose $1 for every $1 you receive in unearned income and fifty cents for every $1 you earn.
In addition, SSDI is your gateway to Medicare. Once you have received SSDI for 24 months, you are eligible for Medicare regardless of your age. Medicare can be a very reasonable source of health care insurance for a person who may not have access through either an employer or the Affordable Care Act (ACA/Obamacare) to a plan with both affordable premiums and an affordable deductible.