Tony Hancock touched the first woman's breast and put his hand down her trousers and tried to penetrate her vagina, Judge Rachel Harrison said on Friday.
But the woman pressed her legs together and Hancock was disturbed when his girlfriend entered the room.
His second victim woke up to find him touching her hair, shoulder and bra strap in an ordeal that lasted ten minutes.
The court heard that the offences happened almost three years ago.
"The victim personal impact statements made it clear you had a profound effect and caused severe psychological harm," Judge Harrison said.
One of his victims stopped attending college, began drinking and then attempted suicide as the result of the assault.
Francis Edusei, mitigating, said Hancock had no relevant previous convictions and is taking medication, but has no mental health issues.
"He is able to cope in the community," he said, adding that Hancock, a dad of three, was now studying English and maths in custody.
A restraining order, banning him from contacting both victims and a third woman, was made for nine years.
Hancock, 30, of no fixed abode, was convicted of attempted sexual assault by penetration and sexual assault by a jury. He was acquitted of a third charge.
He was sentenced to four years in prison and placed on the Sex Offender Register.