Issued by Southampton magistrates, it states he must "wear sufficient clothing in public to at least cover his genitalia and buttocks".
The order is effective for all of England and Wales until 10 May.
If Mr Gough, 53, of Eastleigh, Hampshire, contravenes it, he could be imprisoned again.
Eastleigh Borough Council and Hampshire Constabulary jointly applied for the order.
They said it was because Mr Gough had caused "much offence nationwide" and they also wanted to clarify the legal position.
Mr Gough has served several prison terms for refusing to get dressed in public places, including court rooms.
He was freed on bail on 8 February after a charge of outraging public decency in Oxfordshire in December was dropped.
Roger Trencher, force solicitor, said Mr Gough had also "used a considerable amount of police time in England, Wales and Scotland".
He said: "This is because he insists on rambling naked.
"He refuses to be deterred by the criminal law. He believes the law is uncertain on the issue of public nudity.
"We hoped the court would agree that, because of the public offence that has been caused and the police time used, it is in the public interest that Mr Gough be required to wear clothing sufficient to prevent the offence.
"We sought an order for him to wear sufficient clothing in public to at least cover his genitalia and buttocks.
"Any breach of the order could result in a prison sentence for Mr Gough."

Mr Videgaray was seen as the main organiser of the controversial meeting between Mr Trump and President Enrique Pena Nieto.
The visit was widely criticised by Mexicans both in the national press and on social media.
A spokesperson for the ministry said Mr Videgaray would not take on another public office.
He will be replaced by the current Minister of Social Development, Jose Antonio Meade. Mr Meade previously held the finance portfolio in 2011 and 2012.
Mr Trump, the Republican nominee for the US presidency, visited Mexico briefly on 1 September, despite widespread condemnation of some of his earlier comments about Mexican migrants to the United States.
He had called Mexican migrants "criminals" and "rapists". Such remarks led President Pena Nieto to compare the American to Italian fascist leader Mussolini, and Adolf Hitler.
Mr Videgaray has been one of the president's closest advisers, orchestrating a successful election campaign in 2012.
However, Mr Trump's visit almost immediately caused public relations problems, when he appeared later that day at a rally in Arizona.
There, he told the crowd Mexico would "100%" pay for a planned border wall, though he told reporters he had not discussed the issue with President Pena Nieto.
The president later insisted he had told Mr Trump that Mexico would not pay.
In 2014, Mr Videgaray came under fire when a newspaper investigation revealed he had bought his home from a construction firm whose parent company had won major public contracts.
He denied any wrongdoing or conflict of interest.
President Pena Nieto said the new minister will "apply adjustments to public spending" but there will not be any rise in taxes.
A man known as "the naked rambler" has been given an interim Anti-social Behaviour Order (Asbo) banning him from going nude in public places.
[NEXT_CONCEPT]
Mexican Finance Minister Luis Videgaray has resigned following the visit of Donald Trump last week.