The Supreme Court, after years of skirting the edges of the bitter controversy over affirmative action, agreed yesterday to decide whether goals and quotas are a permissible means of redressing discrimination in the work place.

The court, opening its 1985-86 term, agreed to decide the legality of federal court orders in Cleveland and New York City that mandated the hiring and promotion of specific percentages of minorities. White firefighters in Cleveland and white sheet metal workers in the New York area appealed, arguing that the orders limited their opportunities and made them victims of "reverse discrimination."

Although goals and quotas similar to those at issue in yesterday's cases have become commonplace, the court has never directly confronted their legality. Instead, it has issued relatively narrow opinions in cases beginning with Bakke v. University of California, the highly publicized 1978 case of a man refused admission to a medical school to make room for a member of a minority group.

With the two cases accepted yesterday and a third on the docket, the court has before it the bulk of the legal questions involved in the most common and controversial affirmative action plans.

The Reagan administration has entered the Cleveland and New York cases on the side of the white workers, maintaining that such affirmative action illegally and unconstitutionally violates the rights of white employes.

It contends that the Supreme Court decided as much two years ago in a case involving firefighters in Memphis.

A series of lower court rulings, including decisions in the Cleveland and New York cases accepted for review yesterday, have disagreed with the administration's position.

The justices added 24 cases to their docket yesterday from the more than 1,000 petitions filed over the summer. The new cases, in addition to ones granted last term, fill about two-thirds of the court's 150-case docket for this term.

In addition to the employment cases, the high court agreed to decide:

*Whether people opposed to the death penalty may be excluded from jury service in capital punishment cases; If a school system violated First Amendment free speech rights when it disciplined a student who made a speech filled with sexual innuendoes to a school assembly;

*In a District case, whether an employer may be held liable for damages when, without the employer's knowledge, a supervisor sexually harasses a worker; and,

*Whether a wife, held as a material witness in an espionage case, can be forced to testify before a grand jury against her husband.

The discrimination case from Cleveland, Local 93 v. City of Cleveland, began when a group of minority firefighters sued the city in 1980, saying it used unfair written tests and engaged in other practices that discriminated against blacks and Hispanics seeking promotions. The group, Vanguards of Cleveland, said only 4.3 percent of the firefighters in the higher ranks were minorities in a city with a half-minority population.

A federal judge issued a consent decree in 1983 requiring that half the promotions in the department go to minorities. The Vanguards and the city, which conceded there had been discrimination against minorities, agreed to the temporary quota plan, which was incorporated in a consent decree approved by a federal judge in 1983 over the objection of the firefighters union. The plan is set to expire in 1987.

The union opposed it, and filed suit. The 6th U.S. Circuit Court of Appeals, directly rejecting the administration's arguments, upheld the plan.

The second affirmative action case, from New York City, challenges the power of a federal judge to order an area sheet metal workers' union to raise its membership of blacks and Hispanics to 29 percent by August 1987.

The 2nd U.S. Circuit Court of Appeals last January upheld a lower court ruling that the union had discriminated against minorities and upheld a $150,000 fine against the union for not meeting earlier deadlines imposed by the trial judge to increase the number of minorities. The appeals court also rejected the administration's reading of the Memphis case. Both the city of New York and the New York attorney general have asked that the appeals court ruling be upheld. The case is Local 28 of the Sheet Metal Workers' International Association v. EEOC.

A third case on the docket involves Michigan schoolteachers and tests the constitutionality of a voluntary affirmative action program by a public employer.

The justices also said they would consider an Arkansas case on whether excluding opponents of the death penalty from juries creates a "conviction-prone" jury that violates a defendant's right to a fair trial.

The court 17 years ago said prosecutors may strike from the pool of potential jurors anyone firmly opposed to the death penalty. That decision left open the question of whether such a practice would produce a jury that tended to be pro-prosecution. The 8th U.S. Circuit Court of Appeals earlier this year ruled 5 to 4 that the exclusion of opponents of capital punishment was unconstitutional. The case is Lockhart v. McCree.

The court, for the second time in two terms, will hear a case involving discipline in the public schools. Last year the court gave school officials broad powers to search for drugs.

The case it agreed yesterday to hear, Bethel School District v. Fraser, involves a student who used sexual innuendo in a speech to the student body at a school near Tacoma, Washington. The student, Matthew Fraser, a top-ranking member of his senior class, nominated a friend for class president, saying, among other things, that the candidate was "a man who will go to the very end -- even the climax, for each and every one of you."

School officials said the speech was innappropriate and suspended Fraser for three days. Fraser, whose candidate won the election, sued, saying the speech caused no disruption in the school and the suspension violated his First Amendment rights. The 9th U.S. Circuit Court of Appeals agreed and assessed the school nominal damages and about $12,000 in attorneys' fees.

The justices also will review an opinion from the U.S. Circuit Court of Appeals for the District of Columbia that said a business may be held liable for damages for alleged sexual harassment when a male supervisor harasses a female worker. The case stemmed from a complaint by a former assistant bank manager, Mechele Vinson, against her boss at a branch of what had been the Capital City Federal Savings and Loan, now called PSFS Savings Bank. The case is PSFS Savings Bank v. Vinson.

In another action, the court said it will consider whether one spouse may be forced to testify against the other if both are accused of involvement in a crime. The case, U.S. v. Hana Koecher, involves a former CIA employe accused of passing secrets to Czechoslovakia. His wife was not charged but was detained as a material witness.

Koecher refused to testify against her husband. A federal judge ruled that the traditional exemption of a spouse did not apply when both spouses are accused of participating in the crime. She won on appeal.