A second attempt to break a Senate filibuster against school prayer legislation failed by seven votes yesterday, and liberals claimed that they have the votes to bury the bill for the rest of this Congress.

The legislation seeks to reverse a Supreme Court decision and reinstate voluntary prayer in public schools by stripping the federal courts of jurisdiction over the sensitive subject.

It was the seventh straight time that conservatives, led by Sen. Jesse Helms (R-N.C.), have lost test votes during recent weeks on so-called "New Right social issues," despite help from President Reagan.

With all 100 senators present, the vote was 53 to 47, with 60 required to choke off debate. That meant that opponents had picked up eight votes and Helms only three since Monday, when the first attempt to limit debate failed 50 to 39.

A third cloture attempt was scheduled for today, but opponents claimed victory.

"We've beat them. We've broken the radical right," said Sen. Daniel Patrick Moynihan (D-N.Y.), a filibuster leader. "They have not prevailed. They'll be back, but they won't come back with the presumption of control of the Senate that they once had."

Helms was unavailable for comment. After initial predictions of an easy victory on the school prayer issue, he began to be pessimistic on Monday, saying: "Sixty votes. That's a lot of votes. It's very close."

Previous test votes showed that the Senate is controlled by moderates, Helms said then in an interview. "Conservative it ain't. Republican it is," he said of the Senate.

Helms and his conservative followers suffered a jolting defeat last week, when their drive to enact major new anti-abortion legislation collapsed. It, like the prayer provision, was offered as a rider to a pending debt ceiling bill Congress must pass by Oct. 1 to keep the government operating.

Helms' school prayer amendment would keep federal courts from overturning state laws allowing voluntary prayer in public schools. It was regarded initially as far more likely to pass than his anti-abortion proposal.

A Senate in Democratic hands twice easily passed prayer measures identical to Helms' in 1979, and yesterday House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) said "the votes are probably there" if the prayer issue ever reaches the House floor.

What has changed since 1979 is that the American Bar Association, legal experts and major religious groups have joined liberals in opposing the school prayer measure, partly on grounds that it is an unconstitutional "court-stripping" which would encroach on the independence of the federal judiciary. The Supreme Court barred prayer in public schools in 1962.

Religious groups also have charged that the bill and the Reagan-backed constitutional amendment would be major infringements on the religious freedoms of minority groups.

There were only two switches in yesterday's vote, and pro-prayer forces picked up the support of only three of 11 senators who were absent Monday. Sen. Lawton Chiles (D-Fla.) switched from being against Helms to for him, and Sen. Slade Gorton (R-Wash.) switched the other way, canceling out each other.

Virginia Sens. Harry F. Byrd Jr. (Ind.) and John W. Warner (R) voted for cloture, the legislative term for limiting debate to 100 hours. Maryland Sens. Paul S. Sarbanes (D) and Charles McC. Mathias Jr. (R) voted against it.

When the vote tally was announced, Moynihan jumped to his feet, shouting, "The Senate has prevailed. The Constitution is secure."

Sen. Jeremiah Denton (R-Ala.), a leading New Right spokesman, said he was discouraged by the vote, but vowed, "Nobody is going to give up on the possibility that our children can be allowed to pray in public schools.