The Supreme Court said yesterday that it will decide whether public schools may allow students to meet during school hours for prayer and religious worship.

The court said it will review a ruling that banned such meetings at a Williamsport, Pa., high school, even though the school allows students to conduct virtually all types of nonreligious meetings during the school day.

The Reagan administration attacked a federal appeals court's ban on the meetings, saying it casts constitutional doubt on a new federal law requiring public schools to give student religious groups the same access to school facilities that nonreligious groups enjoy.

The case is Bender v. Williamsport Area School District.

The court also decided, 6 to 3, that unions do not have to represent employes who are close relatives of management. Chief Justice Warren E. Burger wrote the majority opinion in a Flint, Mich., case, NLRB v. Action Automotive Inc.

The justices unanimously upheld a special judge's conclusion that Long Island, although surrounded by water, is for legal purposes considered part of New York state's mainland. The ruling means that ships traveling through Block Island Sound are subject to regulation by New York and Rhode Island. Justice Harry A. Blackmun wrote the opinion in U.S. v. Maine et al.

The court summarily affirmed without opinion a ruling in a case from Greensburg, Ind., that states may not allow judges to punish news organizations for disclosing, before arrest, the identities of criminal suspects named in sealed court documents. The case is Westhafer v. Worrell Newspapers.

The court also agreed to decide several cases, including:

* Whether the trustee of a hazardous waste dump can avoid cleaning up the site by filing for bankruptcy. (Midlantic Natl. Bank v. N.J. EPA; O'Neill v. New York)

* Whether a state, in this case Virginia, can constitutionally deny a prisoner the right to sue for physical injuries suffered because of a jail or prison employe's negligence. (Daniels v. Williams).

* If the federal government is correct that a U.S. appeals court is contributing to water pollution by narrowing the definition of wetlands and making it easier to develop swampy areas. (U.S. v. Riverside Bayview Homes).

* Whether a confession made by an arrested person who has invoked the right to an attorney is valid if police unintentionally obtained the confession during their investigation of a separate crime. (Maine v. Moulton).

The court also let stand several important lower court rulings, including one that struck down a New York law that imposes a mandatory death sentence on a prisoner who commits murder while serving a life term. (New York v. Smith).

The court declined to disturb a federal appeals court ruling that states and communities sometimes may be forced to provide schooling for mentally and emotionally handicapped children. (McDaniel v. Georgia Assoc. of Retarded Citizens and Board of Education for Savannah v. Chatham.)