He was due to be released on 22 September after serving his sentence for breaching bail conditions.
But Westminster Magistrates' Court heard there were "substantial grounds" for believing he would abscond again.
The Australian, 48, is fighting extradition to the US over allegations of leaking government secrets.
He will face a full extradition hearing next year, starting on 25 February, after an extradition request was signed by the then home secretary Sajid Javid in June.
Assange received a 50-week sentence in Belmarsh Prison, south-east London, after being found guilty of breaching the Bail Act in April.
He was arrested at the Ecuadorian Embassy, where he took refuge in 2012 to avoid extradition to Sweden over sexual assault allegations - which he has denied.
District judge Vanessa Baraitser on Friday told Assange, who appeared by video-link: "You have been produced today because your sentence of imprisonment is about to come to an end.