Legally, the statute of limitations addresses this very problem. You aren’t going to be dragged off to jail in your forties for some shoplifting you did in your twenties.
Socially, we probably should adopt something similar. Depending on the crime (non-violent, low cost to society, one time), we should all pretty much pretend it didn’t happen after about 5 - 10 years.