The Reagan administration was accused yesterday of "trying to circumvent the law" by deciding to give 5,000 new National Institutes of Health competitive research grants in fiscal 1985, instead of the 6,500 approved by Congress.

"You people signed this thing; you agreed to 6,500," Sen. Lowell P. Weicker Jr. (R-Conn.) angrily told Health and Human Services Secretary Margaret M. Heckler, referring to the fiscal 1985 appropriations bill for HHS. He has asked the General Accounting Office to determine whether the department's refusal to distribute all 6,500 grants amounts to an illegal impoundment. "Will we have to go to court?" he asked.

At a hearing by a Senate Appropriations subcommittee on HHS' fiscal 1986 budget request, Weicker, the subcommittee chairman, assailed the Reagan administration for proposing cuts in social programs and brushed aside protests by Heckler that the huge federal deficit makes cuts necessary.

Weicker also noted that the administration wants Congress to authorize only 5,000 NIH research grants for 1986, and is creating only three new centers to conduct research on Alzheimer's Disease, even though Congress approved five.

"When you have people suffering from Alzheimer's Disease, don't try to balance the budget on them," Weicker said. "Why balance the budget on their pain?"

When Heckler said that budget problems require tough and hard choices, Weicker retorted, "The tough choices are being made by the tough and well-off to the detriment of the weak."

Heckler said that legal advisers to both HHS and the Office of Management and Budget have told her that it was not illegal for HHS to limit the NIH's fiscal 1985 grants and use the funds that were saved to support those same grants in future years.

In that way, she said, she would not have to ask for additional funds later on. She said that in view of budget problems, if the number of new grants were contained, it would enable NIH to begin a steady level of new projects year after year, instead of having to cut new grants sharply in the future in order to finish funding the old ones. She said the other two Alzheimer's Disease research centers would be started in later years.

Weicker said the fruits of generous research and health care programs show up 12 to 15 years later in improved health statistics. Citing a recent report by the Children's Defense Fund, Weicker said that despite the administration's emphasis on "this business of abortion and pro-life," it has limited research, risked higher infant mortality by freezing medical services for low-income families, and tried to kill community services grants.

But on infant mortality, Heckler said, "Our 1990 goal of no more than 9 deaths per 1,000 births will not only be achieved but exceeded."

On other issues, Heckler told the subcommittee there is considerable "anecdotal evidence" that various employment-search and "workfare" approaches to putting welfare mothers to work are starting to show results. She said that if states were required to make their welfare clients work off their benefits for no pay in positions that would give them useful work experience, 89,000 families would leave the welfare rolls or avoid them in fiscal 1986.

She said about a fifth of U.S. counties now have workfare programs and that 36 states have implemented at least one of several work options.