The nation's economy grew far more robustly than expected at the end of 1978, the government reported yesterday, heightening the debate over whether -- and how soon -- the United States might fall into a recession.

Preliminary estimates showed the "real" gross national product -- the economy's total output, adjusted for inflation -- rose at a vigorous 6.1 percent annual rate in the final quarter of last year, up from 2.6 percent in the third quarter.

At the same time, however, the rate of inflation -- as measured by the comprehensive GNP price index -- surged to an 8.1 percent annual rate last quarter, compared to a 6.9 percent pace in the third quarter.

The more-rapid-than-expected pace stemmed mainly from continued high spending by consumers. "Real" final sales, considered the best measure of total buying, climbed at a 6.6 percent annual rate, up from 3.7 percent the previous quarter.

The strong fourth-quarter performance brought the economy's growth rate for all of 1978 to 3.9 percent -- the top of the range of the Carter administration's most recent forecast. The year's rate is down from 4.9 percent in 1977 and 5.7 percent in 1976.

Shortly after the figures were published, Commerce Secretary Juanita M. Kreps issued a statement saying the report "increases my confidence that the slowdown will not turn into a recession," as some economists have forecast.

However, other analysts pointed out that the faster-than-expected growth rate could ultimately backfire and bring on a steeper decline once the recession actually begins to take hold, possibly in mid-autumn.

The surprisingly rapid pace bolstered the case for the administration's recent shift toward a tighter budget policy for fiscal 1980. Analysts suggested the 6.1 percent growth rate could be revised upward when late data come in.

Carter is expected to propose a $533 billion budget Monday calling for sharp cutbacks in the growth of traditional Democratic social programs in an effort to hold the deficit to below $30 billion.

Carter's budget plan received important new support yesterday from Sen. Warren G. Magnuson (D-Wash.), chairman of the Senate Appropriations Committee. Magnuson said the target "is not unrealistic... and can be achieved."

Meanwhile, Federal Reserve Board Chairman G. William Miller renewed his pledge that the central bank will do "whatever it takes" restrain the growth of the nation's money supply, but said it would not bring on a recession.

Miller also reiterated his opposition to imposition of credit controls by the administration, under which the government would allocate loan money throughout the economy.

The fourth-quarter GNP figures showed the economy continued to be well-balanced at the end of last year, despite its robust performance -- with none of the distortions, such as excess inventories, which often precede a recession.

Overall inventory investment actually declined $1.2 billion over the quarter to a new total of $12.4 billion.

The rise in consumer spending totaled $45.3 billion. up 1.7 percent from the previous quarter's levels -- reflecting sharp increases in motor vehicle purchases, which earlier had dropped off.

Business spending on new plant and equipment, needed to keep the economy going once consumer spending begins to taper off, continued at a respectable pace. For the year as a whole, actual investment volume rose 7.8 percent.

The fourth-quarter inflation figure was bloated in part by the inclusion of last October's federal pay increase in the GNP accounts. Kreps asserted at a briefing that the underlying inflation problem did not stem from overheating.

The fourth-quarter figures brought the inflation rate for the year, by the broad GNP price index, to 7.4 percent, up from 5.9 percent in 1977 and 5.2 percent in 1976.The year-end figure for consumer prices will be published next week.

The end-of-year performance suggested the economy will retain enough momentum to push any recession off until autumn or winter. But it left doubts about how deep any downturn might be. A faster pace now could worsen any slump.

The 6.1 percent annual rate increase in GNP recorded for the fourth quarter was calculated after adjustment for inflation. Before adjustment, the fourth-quarter rise amounted to a 14.7 percent rate, compared to 9.6 percent in the third quarter.

Yesterday's statistics brought the overall GNP figure for 1978 to $2.107 trillion, up 11.6 percent over 1977's level and the first time the nation's total output has exceeded $2 trillion.