If you are a man who lived in the U.S. or got your green card at any time between the ages of 18 and 26, you were expected to register with the U.S. Selective Service System. The Selective Service collects the names of young men who are available to be called up in a military draft. (See 50 U.S. Code Ch. 49.)
The only exception likely to help you is if your entire time in the U.S. between ages 18 and 26 was covered by an unexpired nonimmigrant visa (for example, a student, tourist, or diplomatic visa). Another, less widely applicable exception is made for men born between March 29, 1957, and December 31, 1959—they were never under any obligation to register. For more information, see the Selective Service website.
Notice, however, that no exception is made for undocumented or illegal aliens. They are expected to register. The Selective Service office states that it does not share this information with U.S. immigration authorities.
Registering for Selective Service does not mean that you have to actually become a member of the U.S. armed forces. However, you are expected to be ready to join if a large-scale war or similar emergency arises.
If you knew about the registration requirement and refused to put your name in, U.S. Citizenship and Immigration Services (USCIS) can deny your application for naturalized citizenship. Many young men find out when they fill out Form I-485 in order to adjust status and get a green card, because the form authorizes USCIS to provide your registration information to the Selective Service System. Do not assume, however, that USCIS actually took care of registering you.
If you are getting ready to apply for U.S. citizenship and you did not register for the Selective Service and are not yet age 26, it's not too late. You can still register online or by mail or pick up the registration form at a U.S. post office, fill it out, and mail it in.
If you've passed age 26, it's too late for you to register for the Selective Service. Your chances of qualifying for U.S. citizenship depend on how many years have passed since you were supposed to register and how many years of good moral character you need to show. If you need to show five years of good moral character, then the easiest thing might be to wait until you are age 31 to apply for citizenship.
Or if you need to show only three years of good moral character (because you have been married to and living with a U.S. citizen all that time), you should wait until you are 29 years of age to submit your N-400 citizenship application.
If you are eager to apply for citizenship before you turn 29 or 31 (as applicable), you may be able to show USCIS that you had no idea that registering was expected of you, and that you therefore didn't "willfully" fail to register, by submitting these along with your naturalization application:
A Status Information Letter from the Selective Service simply states that you are over-age and therefore no longer required to register. However, you need to get one, because USCIS will refuse to look at the rest of your materials without it.
You can request the Status Information Letter from the Selective Service System website or by calling 847-688-6888.
Your sworn statement should offer reasons why you failed to learn about the Selective Service registration requirement.
If you attended high school in the U.S., you were probably told about this requirement, and will need to additionally explain why the information did not cause you to register. (For example, perhaps you heard about the requirement but believed it applied only to U.S. citizens.)
You will also have trouble claiming ignorance of the registration requirement if you got your green card either through the amnesty program in the 1980s or more recently, during or after the year 2001. In both cases, people were alerted to their registration obligations.
If possible, get letters from other people who knew you, particularly people in positions of authority, such as a high school teacher. The letters should support your explanation of what happened to result in your not knowing you were supposed to register.
For more information on the process of applying for U.S. citizenship, see Becoming a U.S. Citizen: A Guide to the Law, Exam & Interview, by Ilona Bray (Nolo).