The 47-year-old was found guilty of breaching the Bail Act last month after his arrest at the Ecuadorian Embassy.
He took refuge in the London embassy in 2012 to avoid extradition to Sweden over sexual assault allegations, which he has denied.
In a letter read to the court, Assange said he had found himself "struggling with difficult circumstances".
He apologised to those who "consider I've disrespected them", a packed Southwark Crown Court heard.
Assange jailed over bail breach
Follow us
Get latest news delivered daily!
We will send you breaking news right to your inbox