Facing the shutdown of a government agency whose mortgage guarantees help channel billions of dollars to millions of home buyers, Congress yesterday passed emergency legislation increasing the agency's credit limit and extending its authority to insure loans.

The House yesterday passed a bill identical to one approved by the Senate Tuesday that would allow the Federal Housing Administration to open its offices as soon as President Reagan signs the legislation.

President Reagan is en route to the economic summit in Tokyo. And, a White House spokeswoman said no decision had been made by the president's advisers and lawyers on whether to send the bill by courier to the president. An FHA spokesman said the agency would begin approving applications as soon as the bill is signed.

The FHA closed its doors Tuesday after reaching its loan credit limit of $57.4 billion. It told lenders to stop taking applications for mortgages insured by the agency. The FHA's authority to guarantee loans expired Tuesday night.

FHA loans often are important to first-time and moderate-income house buyers because they offer mortgages requiring only a 5 percent down payment, and lenders are more willing to make these loans because they are guaranteed by the government.

FHA loans account for about 15 percent of all mortgages in the United States, an FHA spokesman said.

The bill passed by Congress would increase the credit limit on FHA mortgage insurance by $17 billion and extend its operating authority through June 6.

The bill also would give new life to the Government National Mortgage Association -- better known as Ginnie Mae, and, like FHA, part of the Department of Housing and Urban Development. This agency guarantees payment on mortgages insured by the FHA and Veterans Administration and bundled into mortgage-backed securities. These securities are then bought and sold by investors.

Ginnie Mae reached its credit limit of $65.3 billion three weeks ago and had to stop issuing guarantees on mortgage-backed securities. The legislation passed yesterday would increase Ginnie Mae's limit by $60.68 billion, which should take the agency through the end of the fiscal year.

The FHA's loss of authority came at a time when home-buying activity is running at a feverish pace. Last month, sales of new homes registered the sharpest monthly increase since 1963, pushed by the lowest mortgage interest rates in eight years.

The FHA had been flooded by homeowners seeking to refinance mortgages as interest rates fell. According to the Mortgage Bankers Association of America, refinancings now account for between 45 and 55 percent of all mortgage activity.

From Oct. 1 through April 15, the FHA received 805,000 applications for loan guarantees on single-family homes. If applications continue at the current rate, a record for the agency will be set, a spokesman said. .

The Mortgage Bankers Association of America had claimed that the lapse in FHA activity would prevent 10,000 Americans a day from getting mortgages under the agency's program.