Here in Poland it is 20 years if in "good faith" - the person living there though they have rights for it (which is... weird in inself but I guess it can happen) but whole 30 if in "bad faith" (i.e. they knew but owner didn't do anything with the area).
> the person living there though they have rights for it (which is... weird in inself but I guess it can happen)
I imagine it happens more often than you'd expect - consider complicated inheritance laws, and so forth.
Parent dies without a will, verbally agreed with sibling that you'd take it, you thought you owned the property but after decades sibling dies and sibling's son inherits all of parents property including part-ownership, and so comes after you for half of the property.
Yeah or simply "parent had some property kids didn't knew they bought". Or it was some "a bunch of people owns some fraction of property and nobody cared enough to deal with it".
One weird case I saw was some property where brother owned 5/6 and sister owned 1/6 of it.
Turns out after father died mother,sister and brother each got 1/3, but mother put all of hers in will to be given to the brother
I assume a more common scenario is something like expanding the property line. Person A technically owns the plot, but neighbor B thought it was on their side of property, and has been letting their animals graze on it for the past decades. Until eventually a surveyor appears to correct the record and that is when the land-user can claim possession.