Whether a child born to an undocumented (often referred to as illegal) immigrant can lawfully stay in the United States depends on:
We'll describe both scenarios below.
The 14th Amendment to the U.S. Constitution reads: "All persons born or naturalized in the United States, and subject to the jurisdiction thereof, are citizens of the United States and the State wherein they reside."
This particular amendment was originally ratified in 1868, so that newly emancipated slaves (who were originally from Africa) were given U.S. citizenship. It has, so far, been interpreted to mean that children born in the United States to undocumented aliens can legally stay in the United States as U.S. citizens.
However, many people argue that allowing citizenship to the children of undocumented immigrants was not the original intent of the authors of the 14th Amendment (who didn't even consider the issue of immigration, because no limits then existed on who could enter the United States). Members of Congress occasionally raise the possibility of legislatively changing this interpretation of the Constitution in order to deny citizenship to children of undocumented immigrants.
The 14th Amendment is also understood to prohibit children born to foreign visitors, ambassadors, consuls, and so on from becoming citizens. The rationale is that there's no rational basis to award them citizenship simply because their parents happened to be in the United States on the errand of their native country at the time a child was born.
Many undocumented immigrants bring their children to the U.S. when the children are very young. The children grow up speaking English, attending U.S. schools, and in every way considering themselves equivalent to U.S. citizens. However, under current law (despite various legislative proposals), they have no direct path to legal status or citizenship.
That doesn't mean that their situation is hopeless. Such children might, for example, qualify for asylum; for a green card based on marriage or another close family relationship to a U.S. citizen or permanent resident; or if they find themselves in removal proceedings (before an immigration judge), for a form of relief called cancellation of removal.
Still, the path to a U.S. green card under any of these scenarios will not be easy. The fact of their long stay in the U.S. can, in some instances (particularly after the child turns 18), hurt their ability to obtain the green card. Overstaying a visa also comes with various immigration consequences. Illegal entry to the U.S. comes with its own additional consequences, particularly in that it bars adjustment of status in many situations; thus forcing immigrants to leave the U.S. in order to attend their visa interview at a U.S. consulate, which can result in them being stuck outside the U.S. with no appeal after a denial.
For some, there's the possibility of qualifying for Deferred Action for Childhood Arrivals or (DACA), but this was created by presidential executive order, and has been the subject of efforts to undo it and lawsuits.
If you have questions about your immigration status or that of your child, consult an experienced immigration attorney. The attorney can help analyze who is a citizen and whether non-citizens have a possible path to a green card.