The House gave bipartisan approval yesterday to legislation opposed by the Reagan administration that would extend for five years education aid programs used by millions of undergraduate and graduate students.

The bill, approved 350 to 67, would provide $10.6 billion in fiscal 1987 alone for Pell grants, guaranteed student loans and other politically popular higher education programs that President Reagan has repeatedly targeted for cuts or elimination. The measure now goes to the Senate for consideration.

Although the measure preserves the programs without the cutbacks envisioned by Reagan, it does reduce spending somewhat by imposing new requirements on students receiving aid and by making several other changes.

The administration criticized the bill as too expensive, but during two days of debate this week lawmakers on both sides of the aisle praised the measure as a fiscally responsible effort that continues a tradition of trying to give all students, regardless of wealth, access to college and graduate school.

Rep. William F. Goodling (R-Pa.) called the administration criticism off base and said the bill "more than meets the test of fiscal responsibility . . . . "

According to the committee report, the legislation would reduce authorized spending for the education programs by $1.3 billion in fiscal year 1987.

But opponents argued that the $1.3 billion is a false savings because actual spending on the programs has been well below the authorized level. As a result, they said, the bill really would allow an increase in spending of about $1.3 billion next year.

"This is a year of budget freezes in which every program is judged by a freeze concept . . . . " said Rep. Steve Bartlett (R-Tex.), who unsuccessfully offered an amendment that would have frozen spending for all but the student-aid portions of the bill at this year's level..

The legislation approved yesterday was the most recent updating of the Higher Education Act first passed by Congress in 1965. It funds a broad array of post-secondary education programs, the largest of which are Pell grants, for lower income students, and federally guaranteed student loans.

About 2.6 million undergraduates now receive Pell grants of up to $2,100 a year. The bill would raise the annual Pell grant to $2,300 for fiscal year 1987, with increases of $200 in each succeeding year; it would tighten the definition of an independent student to make it more difficult for students to separate themselves from familiy income in determining eligibility.

About 3.2 million graduate and undergraduate students receive federally subsidized loans through the guaranteed loan program. The bill would apply a needs test to all families, not just those with incomes above $30,000, as is currently the case. It also would include for the first time a family's assets, and not just income, in the needs test.

At the same time, the bill would retain the $2,500 annual borrowing limit for undergraduates in the first two years of college, but would allow them to borrow $5,000 a year in their last two years. The bill would extend the grace period for repayment of loans from six to nine months after graduation beginning with students receiving loans in 1988.

As a cost-saving measure and incentive for borrowers to repay their guaranteed loans quickly, the legislation would increase interest rates on the loans from 8 percent to 10 percent, beginning in the fifth year of repayment.

In an effort to deal with loan defaults, which now total over $3 billion, the bill would tighten loan-collection procedures, and have loans disbursed in installments, instead of in one lump sum.