The crime can be punished by up to ten years jail.
The crime can be punished by up to ten years' jail.
They are both correct.