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."
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.