The World Bank yesterday announced that it will lend up to $3 billion to developing countries for oil and natural gas exploration and production.

Capping more than two years of discussion, the bank's widened energy production programs could provide loans to more than 50 less-developed countries over the next five years.

"This opens the doors to new development," said Efrian Friedman, head of the World Bank's energy specialists. Friedman says the new energy programs would help some undeveloped countries, which are now importing oil and gas, to become self-sufficient in energy, and could help other countries become net exporters.

The expanded energy loan program would double the extent of the World Bank's energy program over the next five years.

Ernest Stern, a World Bank vice president, cautioned yesterday that "only a small amount will go to exploration drilling" and estimated that two or three loans a year will be made for exploration projects.

This provision of the World Bank program had been opposed until recent months by officials in the Energy and Treasury departments, but won approval from the United States and others on the 20-member board of directors this week.

A staff proposal circulated to the bank's directors last month said that it would lend up to $450 million over the next five years for exploration.

Yesterday, however, Stern and other bank officials said that more than half of the loan programs for petroleum will go toward developing known oil and gas fields.

Opposition earlier to the World Bank program stemmed from objections, since overcome, that the bank should not be involved in lending money for high-risk oil exploration. At the Bonn economic summit last summer, however, the heads of state of industrial countries agreed in principle that the bank's activities in energy should be widened to help alleviate the severe impact that high oil prices have had on the developing countries who are not members of the Organization of Oil Exporting Countries (OPEC).

Bank officials have estimated that as many as 50 or more Third World countries could become self-sufficient in oil production by 1990 if the bank's program is successful. The bank also issued projections suggesting that the non-OPEC developing countries could lower their overall oil imports from nearly 2 million barrels of oil a day in 1975 to about 800,000 barrels of oil a day by 1985.

Nevertheless, the non-OPEC developing countries will be importing a total of 4.3 million barrels of oil a day by 1985, at a cost of $38 billion, compared with $14.3 billion in 1975.

Friedman says that many Third World countries have expressed interest in the new loan program, Bolivia and perhaps Colombia, he said, could qualify for loans for exploration drilling. He also said that the bank's program could help reverse the general trend of a decline in oil exploration in most non-OPEC developing countries, since the fourfold oil price increase in 1973.

A bank report released to the public yesterday said that Third World countries that have large populations which offered good prospects for oil development include India, Argentina, Turkey, the Philippines, Colombia, Peru, Pakistan and Vietnam.