That is if you aren't jailed without chance for a parole until X years.
Do you really think there's a minimum number of years to rehabilitate someone from theft? Vandalism? Murder?
If you believe it's solely about how long it takes to rehabilitate people, then sentencing shouldn't exist. Prisons should be run drastically different. And records shouldn't be made public because one of the main causes of recidivism is the stigma you get from being a felon.
This is why parole hearings exist. You don't need to decide the number in advance.