In an outpouring of support for antiapartheid forces in South Africa, about 40,000 people rallied in Central Park today to protest with songs and speeches, many of them calling on President Reagan to impose new and strict economic sanctions on Pretoria.

"We take pride in the solidarity we have with the people who marched wave after wave to this rally here today," said Alfred Nzo, secretary general of the African National Congress and a friend of imprisoned South African activist Nelson Mandela. "The America that I see here today supports the struggle for freedom in South Africa and opposes this so-called policy of constructive engagement."

Randall Robinson, executive director of TransAfrica, the group that has sponsored protests outside the South African Embassy in Washington, sharply criticized Reagan administration policy of "quiet diplomacy" to foster reforms in the apartheid system of strict racial segregation.

"The president has asked black South Africans to wait for their freedom. But we ask him: How long?" Robinson said. "One month is too long, one year is too long, even one minute is too long. Freedom now, freedom now, freedom now," Robinson said, exhorting the crowd to cheers.

Today's rally marked the 10th anniversary of the violent clash between black students and police in the South African township of Soweto, in which more than 500 blacks were killed. The daylong schedule of events today, sponsored by the New York Anti-Apartheid Coordinating Council, began with protest marches in Harlem, Greenwich Village and lower Manhattan that ended on the park's sprawling Great Lawn.

The crowd heard speeches from leaders of the outlawed ANC, which calls for the overthrow of the Pretoria government, and from antiapartheid movement officials in this country, New York labor leaders, the Rev. Jesse L. Jackson, former tennis pro Arthur Ashe, entertainer/activist Harry Belafonte and NAACP President Benjamin Hooks.

Organizers said most of those attending the rally were from the New York area, but the turnout included protesters from as far away as California and Texas. The racially mixed crowd, many dressed in shorts and T-shirts in the 85-degree heat, waved red, black and green liberation banners and signs that said "Free South Africa" and "End Apartheid Forever."

Groups from New York's large West Indian, Asian and Hispanic communities attended, and several said they came because they were distressed that the Reagan administration has failed to take strong measures to help bring about a peaceful resolution to the racial struggle in South Africa.

"What's going on in South Africa is deplorable, but what is even more deplorable is that the U.S. is part of it all and the president refuses to do anything," said Amy Boyd, 39, of the Bronx.

Andy Clatt, 35, of West Virginia, said he drove to the rally with his 10-year-old son, Ben, because he "was upset with the acuteness of the crisis in racist South Africa. A blood bath is coming, and Americans have to do something to stop it."

In a speech that drew loud cheers, Jackson compared the system of apartheid to the atrocities of Nazi Germany.

"When dogs bite and bullets pierce the skin, human beings bleed everywhere," Jackson said, referring to South African police actions under that nation's new state of emergency.

Mpho Tutu, the daughter of Nobel Prize-winning Anglican Bishop Desmond Tutu, one of the leading voices of opposition in South Africa, said her country "is on the brink of a full-scale civil war and a blink away from Armageddon."

The rally ended with performances by reggae singers Marcia Griffiths and Judy Mawatt and rock musician and antiapartheid activist Little Steven Van Zandt.

Vivian Stromberg, one of the organizers, said, "We were a rainbow of people and colors and background, and we came together to oppose apartheid. Since our government doesn't speak for us, we have to speak for ourselves."