Winnie Mandela, said by her doctor to be sick after three brawling encounters with the South African police in just over a week, was released on bail today and is spending tonight in an hotel just beyond the limits of this city she is prohibited from entering while she considers whether to continue her test of wills with the white authorities.

Mandela, a leader of black resistance to white-minority rule, has already been arrested twice for defying the restriction order that bars her from entering Johannesburg where she has a house, and today a magistrate made bail conditional on her not trying to enter the city again.

That means if Mandela continues her defiance she will not only be arrested a third time, but will forfeit her $200 bail and be kept in custody until her trial Jan. 22 on charges of violating the restriction order.

She can be imprisoned for up to three years on each of the two charges she already faces.

Mandela made it clear to reporters as she left the court in Krugersdorp, west of here, that her inclination was to continue her defiance, but friends, lawyers and her doctor spent the next eight hours trying to persuade her that she needed a rest.

Her doctor, Abu Asvat, said Mandela was exhausted, had high blood pressure which had been aggravated by the tensions of the past week, and a spinal problem which had been made worse by rough handling she had received during the arrests.

Eventually Mandela agreed to postpone her decision and check in to the hotel for the night.

There were more dramatic scenes after today's court hearing as Mandela consulted with her doctor and lawyers in a house in a black township outside Krugersdorp.

Riot police arrived as scores of local blacks came to the house to pay their respects to Mandela, who is the wife of the imprisoned African National Congress leader, Nelson Mandela.

When a group of young blacks came jogging down the road chanting slogans in praise of Nelson Mandela, police ordered them to disperse, then fired tear gas.

Several reporters, including a British television crew, were arrested and some were taken away. A police officer declared an "unrest situation" to have arisen, and, under the terms of emergency regulations, ordered all reporters to leave the area within 15 minutes.

Mandela looked cheerful as she appeared in the magistrate's court after spending a night in the police cells for the second time since the new restriction order was served on her Dec. 21.

Mandela's lawyer, Gilbert Marcus, opposed the state's application for bail to be made conditional on her not entering Johannesburg or a neighboring town called Roodepoort, the practical effect of which is to prevent Mandela from living in her family home in the black township of Soweto.

Prosecutor C. Krause argued that the bail condition was reasonable, and suggested that if Mandela had no other accommodation, "then the state can provide her with a house."

In other developments today, Law and Order Minister Louis le Grange extended for another six months a ban on indoor meetings in 30 districts by 74 organizations, including the country's main black activist movement, the United Democratic Front.

Police reported another day of widespread racial violence. A black councilor was killed and five other blacks were injured by a hand grenade when fighting broke out in Cape Town's Guguletu township between black militants and others regarded as collaborators in the apartheid system of segregation.

In a New Year broadcast to the nation tonight, President Pieter W. Botha said the past year had been a turbulent one "during which terrorist forces operating from outside tried to overwhelm our country and its people."

When South Africa tried to combat these forces, "some countries which should have known better unashamedly applied double standards against South Africa," Botha added, in an apparent reference to western critics.

The financial daily Business Day quoted an African National Congress spokesman in Lusaka, Zambia, as disclaiming responsibility for the bomb that killed six whites and injured 61 in a holiday resort shopping center two days before Christmas