Prison sentence is not an Islamic prescribed punishment. Therefore, it has not effect on the punishment on the Day of Judgment. Only the prescribed punishments such as flogging, amputating the hand or beheading can take over the punishment on the Day of Judgment.
The Prophet salla Allahu alaihi wa sallam told us that whoever is punished in this life, this would act as a purification for him and he will not be punished for it on the Day of Judgment.
Having said that, if your friend repented from his sin and felt deep remorse and firmly intended not to go back to that sin once again, Allah will forgive his sins.