Assange, as a bail jumper and fugitive, requested and received asylum from Ecuador.
He could have, at any time, left the Ecuadorian embassy. In fact, had he done so, he'd likely have been investigated, prosecuted and potentially convicted of the charges against him.
Had that come to pass, it's entirely likely that Assange would have completed any sentence of incarceration years ago and have been back to banging Swedish girls for quite a while.
As we'll see, Assange might be convicted of violating the Computer Fraud and Abuse Act[0] which, under these specific circumstances (n.b.: IANAL) would carry a sentence of not more than five years, with the opportunity to reduce that sentence[1] by more than six months, assuming he is not given parole.
As to the completely bogus "charges" of violating the Espionage Act of 1917[2], no journalist has ever been convicted under that law.
As such, had Assange not decided for himself to jump bail and become a fugitive, he would most likely have been a free man for at least several years right now.
[0] https://www.law.cornell.edu/uscode/text/18/1030
[1] https://www.carmichaellegal.com/federal-sentencing-reduction...
[2] https://en.wikipedia.org/wiki/Espionage_Act_of_1917
Edit: Fixed typo. I need to do better proofreading before I post. :(