Parents Chris Gard and Connie Yates have launched a final legal challenge at the European Court of Human Rights after a Supreme Court challenge failed.
European judges said doctors were required to keep the 10-month-old alive until they had passed judgement.
Specialists at Great Ormond Street believe he has no chance of survival.
Charlie has been in intensive care in hospital since October last year.
His doctors said he cannot hear, move, cry or swallow and that his lungs only go up and down because he is on a machine that does it for him.
Judges in Strasbourg, France, had previously ruled an interim measure to keep him alive should remain in place until midnight on 19 June.
The new extension lasts until a final ruling is made.
A spokesperson said the court "will treat the application with the utmost urgency" but have not indicated when the final judgement will be made.
Charlie's parents, from Bedfont, west London, have raised Â£1.3m on a crowdfunding site to pay for an experimental treatment in the US.
In April a High Court judge ruled against the trip to America and said Charlie should be allowed to die with dignity.
Three Court of Appeal judges upheld the ruling in May and three Supreme Court justices have dismissed a further challenge by the parents.
Charlie is thought to be one of 16 children in the world to have mitochondrial depletion syndrome, a condition which causes progressive muscle weakness and brain damage.
Terminally-ill baby Charlie Gard must continue to receive life support until judges make a ruling on whether he should undergo a trial treatment.