Does the word "sentence" have the same definition in the next two sentences?

The judge leniently granted a sentence with no hard time. He is not living at home because he is doing time.

His sentence was 5 to 10 years.
the same meaning