Winnie Mandela, wife of South Africa's imprisoned black nationalist leader Nelson Mandela, today lost a court application to have her latest restriction order declared invalid.

Meanwhile, Assistant Secretary of State for African Affairs Chester A. Crocker delivered a letter from President Reagan to President Pieter W. Botha. Crocker met with Botha for 90 minutes in Cape Town.

Provincial Supreme Court Judge Louis J. le Grange, ruling on the Mandela case, said that security laws placed the order beyond his jurisdiction and that he was not allowed to pronounce upon it. But he gave permission for an appeal, which means Mandela's application will be heard again by a panel of three judges of the same Supreme Court division, possibly within the next six weeks.

Mandela is due to appear in a lower magistrate's court on Jan. 22 on two charges of defying the restriction order, which prohibits her from living in her house in Johannesburg's black township of Soweto. Her lawyers said the trial was unlikely to go ahead before the appeal was heard.

If she wins the appeal and the restriction order is invalidated, the charges will fall away. If she lost again and was then convicted for her acts of defiance, she could be sentenced to three years' imprisonment on each charge.

Mandela is living in what lawyer Ismael Ayob described as "a safe place" outside the city. He said it was unlikely that she would defy the order again as she did last month, resulting in confrontations with the police.

The case illustrated a feature of South Africa's system of white-minority rule in which the executive can exercise sweeping arbitrary powers, but where a system of formal legality is maintained that sometimes enables aspects of these executive actions to be challenged in the courts.

Mandela challenged the legality of her restriction order on a technicality, claiming that it was invalid because the minister of law and order, Louis le Grange (no relation of the judge), had failed to give reasons for imposing it, as the Internal Security Act requires him to do.

The Associated Press reported from Johannesburg on Crocker's visit:

The assistant secretary of state is in South Africa to press the white-minority government on apartheid and independence for Namibia.

Crocker, who made no statement, then met for more than five hours with the foreign and defense ministers. The Cape Argus newspaper reported, without attribution, that Reagan appealed for "decisive action" on reforms in apartheid and on independence for Namibia, also called South-West Africa, which South Africa controls in defiance of the United Nations.

Crocker arrived yesterday from Angola, the Marxist-ruled country on Namibia's northern border. South Africa periodically sends military units into Angola in search of Namibian guerrillas.

Angola's government also claims that South African troops fight alongside Angolan rebels, while South Africa and the United States demand the withdrawal of approximatly 20,000 Cuban military personnel stationed in Angola.

Meanwhile, at Stutterheim in eastern Cape Province, a black policeman fired into a mob of 1,000 blacks who attacked his home with gasoline bombs. Three persons were shot to death, including a woman, police said. They reported antiapartheid rioting and stone-throwing in six other places.