This question raises the difference between legal and equitable concerns.

Certainly, at law, in most jurisdictions it doesn't matter how long a person residing in a country illegally has been there.

The question though is whether it should matter - because after a certain point, it may be more disruptive to society as a whole to have a person residing illegally deported, than to somehow regularize their situation.

Problem is the concern that such a rule would basically encourage law-breaking. A similar concern is raised by limitation periods - that if you 'get away' with an offence for so long, you effectively 'get away' with it forever.