Consumers will get checks cleared sooner and the government will be able to start closing or selling hundreds of failing savings and loan institutions under a compromise banking bill passed 96-2 yesterday by the Senate.

The bill, which was hammered out by Senate and House conferees in recent weeks and was passed by the House Monday, could be signed into law by President Reagan as early as Saturday, congressional aides said.

If Reagan signs the bill, which he is expected to do, the nation will have its first major banking legislation in five years. Reagan last week promised to sign the legislation after Treasury Secretary James A. Baker III devised a last-minute compromise with congressional banking leaders.

The bill requires banks to make funds available to depositors for checks written on local banks after two intervening business days starting in September 1988 and after one intervening business day starting in 1990. Banks would be able to hold funds for checks written on out-of-town banks for a maximum of six intervening business days starting September 1988 and four intervening business days in 1990.

The bill also enables the Federal Savings and Loan Insurance Corp., the insolvent federal fund that insures S&L deposits and manages institutions when they fail, to raise $10.8 billion through an issuance of bonds, no more than $3.75 billion of which can be issued in one year. Raising the money will take several months, but the guarantee of new funding will have the immediate effect of enabling FSLIC officials to begin resolving 400 problem S&L cases.

The problem S&Ls lose an estimated $10 million each day that they are allowed to remain open, a sum that adds to the government's ultimate cost of cleaning up the mess. The government has been unable to shut the institutions because FSLIC's funds have been depleted by record S&L failures. FSLIC ended 1986 more than $6 billion in the red.

The $10.8 billion in bonds, which will be paid off by the S&L industry, is far less than the $15 billion rescue package the White House wanted but twice the $5 billion many in the S&L industry favored. The lower figure was supported by executives at unhealthy S&Ls who do not want their institutions closed and by executives at healthy S&Ls who do not want to pay for the industry's problems.

In addition, the bill will close the loophole for nonbank banks, or limited-service banks. A nonbank bank is an institution that offers checking or makes commercial loans but not both, and thus avoids federal restrictions on who may own full-service banks and where such banks may operate.

Sears, Roebuck & Co., Merrill Lynch & Co. and companies from a variety of other industries have used nonbank banks to enter banking. The bill allows Sears, Merrill Lynch and 166 other owners of nonbank banks created before March 5 to keep the institutions. But it limits the asset growth of the surviving nonbank banks to 7 percent a year.

Closing the nonbank bank loophole is considered a major victory for small banks and large regional banks, which wanted to halt encroachment by securities firms and other industries into banking. But overall the bill is considered a victory for the securities industry and a major setback for the nation's largest banks, which have wanted greater freedom to enter new markets.

The bill imposes a 7-month freeze on a decade-long march by full-service banks into competitors' fields such as securities underwriting, insurance and real estate. Sen. William Proxmire (D-Wis.), the chief author of the bill, said that during the freeze he will push Congress to pass additional banking legislation that will define just how far commercial banking, investment banking and other financial services should mix.

Many lobbyists and industry executives doubt Congress will have any greater luck now than in recent years. Since 1982 every attempt to enact fundamental banking reform has failed.

Proxmire has promised that he will not let Congress extend the freeze when it expires March 1 should lawmakers fail to enact additional banking law. But the securities industry and the S&L industry are expected to push to extend the freeze in the hope of preventing commercial banks from expanding further into their markets.

In addition, the bill passed yesterday: Permits banks heavily tied to economically depressed farm regions to write off bad agricultural loans over seven years rather than all at once. Loan writeoffs cut profits, and the ability to stretch them out will enable many farm banks to artificially inflate their bottom line and thus meet federal regulations.

The S&L industry has long been criticized for adopting similar accounting maneuvers, which it calls regulatory accounting principles. But even as the bill allows farm banks to adopt more relaxed accounting standards, it requires S&Ls to return by 1993 to generally accepted accounting principles, the stricter rules that are used by most companies.

Allows most types of financial and nonfinancial firms to bid for ailing S&Ls. The exception involves companies that own a securities firm or a nonbank bank. The bill allows such companies to bid only on ailing S&Ls with assets of $500 million or more. Permits $800 million of the $10.8 billion in new FSLIC funds to be used to reimburse 2,300 S&Ls for a special insurance reserve that was wiped out earlier this year when FSLIC was declared insolvent