The House voted 310 to 20 yesterday to create a Department of Energy, but directed that it go out of existence at the end of 1982 unless it proves its worth.

A House Commerce subcommittee, meanwhile, took preliminary votes on a section of President Carter's ominibus energy bill requiring local utilities to hep owners insulate their homes. It put off until Monday a vote on a provision requiring all owners to insulate their homes by 1985 if they wish to sell them.

The House vote assures creation soon of a new department pulling together most federal energy functions to administer the national energy policy Carter has asked Congress to enact. The Senate has passed a companion bill which the administration prefers.

James R. Schlesinger, Carter's energy adviser who will become secretary of the department, said the administration will push for the Senate bill when conferees meet to settle differences. The House bill goes Farther than the Senate in denying the secretary the power to set natural gas prices. Both bills give the price-setting power to an independent commission, but the Senate gives the secretary some input and the President a veto.

The House "sunset" amendment - which would abolish the department in five years unless Congress passes legislation to continue it - was approved, 202 to 126. To require that a new agency justify its existence has been much discussed recently but never applied to such a large institution.

Rep. James T. Broyhill (R.N.C.), who offered the amendment, told the House:

"This is a $10 billion agency with 20,000 employees, an agency with awe some power to control energy which is needed to operate our economy. All I am asking is that Congress review the activities of this agency. Congress does a very good job of reviewing their activities."

Rep. John E. Moss (D-Calif) opposed the amendment, arguing that uncertainly does not promote efficiency.

An amendment by Rep. John Conyers (D.Mich.) that would empower the President to make the department sole purchasing agent of foreign oil was rejected with only 16 votes in favor.This was a watered-down version of an amendment which Conyers succeeded in attaching to the bill briefly in the Government Operations Committee last month. Conyers would have government replace oil companies in negotiating with oil-producing nations in hopes of getting a better price. The oil industry opposed the amendent as a first step toward nationalization, but Schlesinger has promised to study it.

As sent to Congress by Carter, the portion of the energy bill considered by the House Commerce subcommittee would require local utilities to:

Inform customer of the benefits of insulation, inspect their homes, make or arrange for insulation loans, give customers a list of insulation suppliers in the area, and install insulation on request.

The subcommittee argued for four hours over such issues as whether utilities confronted by heavy expenses in converting to coal should be required to make insulation loans, and whether a utility which inspects should also be permitted to act as supplier.

By a 10-10 tie the subcommittee refused to strike the requirement that utilities make loans upon request. But by voice vote, the members limited the loan a utility must make to $3,000, effectively restricting it to one or two family units. The bill before the subcommittee requires utilities to provide help to apartments as well as single-family homes.

The subcommittee decided that, generally speaking, utilities should not be permitted to go into the insulation business. But in an effort to get the program moving, it voted 11 to 9 to permit utilities to install insulation when a state government or federal energy department decideds the number of suppliers in an area is inadequate.

The subcommittee also wrote in a series of protections for homeowners. It required assurances that utilities would not discriminate in compiling lists of insulation suppliers available in an area. And it provided that an electric power company, for instance, could not inspect a house having a gas furnace and recommend switching to electric heat.

The most controversial amendment to be offered Monday to this part of the bill would forbid any federally insured lending institution to make a home loan after Jan. 1, 1985 to purchase a residence not insulated up to standard. This would apply to the sources of virtually all mortgage money and in effect make the insulation program mandatory. The House Banking Committee has had two unsuccessful experiences recently in trying to police mandatory programs in this manner.

On Monday the House Ways and Means Committee will begin voting on the tax provisions of the Carter package, including a standby gasoline tax, a tax on gas-guzzling new autos and a tax to raise the price of oil.