Energy Secretary James R. Schlesinger predicted yesterday a continued easing of the gasoline crunch, saying refiners could make available in August 98 percent of the amount they supplied for that month last year.

Sufficient gasoline should be available, he said. "If a family wants to take a [driving] vacation as planned, it could do so," he said, but he cautioned that the only way to avoid all risk of encountering a gas shortage is "to stay close to home."

Schlesinger also said there should be ample stocks of home heating oil this winter. Inventories of heating oil were 157 million barrels as of July 20 - on track to reach the Carter administration's goal of 230 million to 240 million barrels in October, he said.

However, Schlesinger said all bets are off if there are any further interruptions in the flow of crude oil. None is expected, but he noted a recent reduction of 300,000 barrels a day in Nigerian oil production somewhat offsets a million-barrel-a-day increase by Saudi Arabia and "underscores the precariousness of supply."

" Any unforeseen disruption could cause major difficulties," Schlesinger warned.

However, he discounted reports that Algeria is reducing by 20 percent the amount of oil it has been selling under contract. Some countries have cut such sales so that they can sell the oil for higher prices on the spot market, he said.

None of the caveats dimmed the basically optimistic outlook the energy secretary described. Even after the Nigerian cutback, total oil production by the Organization of Petroleum Exporting Countries (OPEC) is running more than 31.5 million barrels a day, he said, about the level forecast last fall before the Iranian revolution threw the world oil market into turmoil.

Part of today's demand is for oil to rebuild inventories drawn down while Iranian oil exports were halted. Schlesinger indicated that the world market would remain "snug" this quarter and that market pressures "may or may not be relieved in the fourth quarter."

Many industry experts believe the market will ease once world inventories are rebuilt.

One reason for Schlesinger's optimism about gasoline availability is what he termed a "surprising increase in gasoline stocks." Gasoline inventories have been rising for the last several weeks, at a time when they normally are falling under the demands of the peak driving season.

Schlesinger, as he has in the past, criticized the oil companies for being "too conservative" in setting their allocations - the percentage of last year's supply of gasoline delivered to most service stations in the same month this year. More gasoline should have been available to motorists, he indicated.

Gasoline stocks averaged 231.9 million barrels during June, almost 20 million barrels higher than stocks a year earlier. This June, many parts of the nation were plagued by long lines at gas stations. A year ago, with smaller stocks on hand, there were no lines.

Based on data for the first three weeks of the month, July inventories will be even higher than June's despite larger deliveries by most companies to their retail outlets.

Schlesinger also criticized oil refiners for producing less heating oil and diesel fuel than they could from each barrel of crude, so as to make more gasoline.

In other matters, he said that if his nominated successor as energy secretary, Charles Duncan, is confirmed by the Senate before Congress begins a month-long recess Aug. 3, he will leave his DOE job about three weeks later.

Schlesinger said that he had had "discussions" about taking another position in the Carter administration but that he would not be doing so. He declined to say what position was involved.

He acknowledged that the Cabinet upheaval in which he lost his job had hurt the chance of getting quick passage of President Carter's new energy program.

"The sum of the momentum established by the president's speech a week ago last Sunday may have been lost temporarily," he said."It is our task to restore that momentum...."