Google Windfall Elimination Provision. It applies to federal employees (like me) and other public employees (state employees etc) who have pension plans that don't require that they pay into Social Security. I'm no expert on WEP, but basically, if you're coverend under such a plan, then you will be penalized unless you have 30 full years of "qualified" contributions into SS. A "qualified" year is one in which your social security covered income meets some pre-determined minimum threshold. Again..no expert, and only shooting from the hip...I believe that this year that qualified income would have to be somewhere around $30,000 or so.
In my personal situation, I worked during high school in SS covered jobs, making not much money, but still enough to earn SS "quarters". Then, while on active duty, the same situation. Once I went to work for the federal government as a civilian employee in 1981, I was no longer paying into SS. Sort of. Since I WAS a reservist, I was paying in a small amount each month, but that amount was too small to really count for anything. So....basically...I earned my rights to a future SS check when I reach the required age, because I did earn the minimum of 40 Quarters, but since I only paid in a small amount, and that contribution was mostly way back in the 70's & early 80's, and from then on I was covered under a public pension system in which no SS taxes were witheld, when I begin receiving my SS payment, it will be reduced by approximately 55%. If I start getting SS at age 62 (9 yrs from now) it will only be around $300.
I know I've left out a lot, so best bet is to google WEP/Windfall Elimination Provision. I expect you can find good info on it at the SS website as well. They recently sent me some WEP info in the mail.