All men must register for the Selective Service at age 18. Not women though. So much for gender equality. You must register:
between ages 18 and 26
You can register for Selective Service online, even if you’re an undocumented immigrant, which seems a little odd to me, as you don’t then necessarily have any rights to live in the US.