The economy turned in its worst performance in nearly two years during the last three months of 1976, the Commerce Department reported yesterday.

The real gross national product - the total goods and services produced by Americans - grew at an annual rate of 3 per cent, well below the 4 per cent rate economists say it must grow if the economy is to provide enough jobs merely to keep unemployment from rising.

It grew at an annual rate of 3.9 per cent in the third quarter of 1976.

But the slowdown in growth occurred not because businessmen and consumers bought less - real final sales increased from 4.3 to 4.8 per cent - but because businesses added fewer goods to their inventories.

John W. Kendrick, chief economist for the Commerce Department, said that while the three months as a whole look bad, things were getting better in November and December. He told reporters that this late-year improvement will accelerate during the early months of 1977.

Arthur Okun, an economist at the Brookings Institution, a nonprofit Washington social science research organization, agreed. Okun said that while on the face of it 3 per cent growth is dismal, the third-quarter growth rate "tells us more about where we have been than where we're going."

The gross national product is the broadest measure of economic performance that analysts have. While economists caution against using it as a measure of how well off the society is, when the GNP is growing, the number of persons with jobs rises, and when GNP falls for a period, unemployment rises.

After economic growth spurted during the first part of 1976 - bringing the unemployment rate down to 7.3 per cent last May - it slowed markedly in the spring, summer and fall. With that slowing came an increase in the unemployment rate. Unemployment peaked at 8 per cent in November, then fell to a revised 7.8 per cent in December, due in large part to that pickup in growth during the last months of 1976.

President-elect Jimmy Carter has proposed a package of tax cuts and spending increases designed to further stimulate economic growth and a recovery in employment.

Many liberal economists think that the Carter package - which provides $30 billion in tax cuts and spending increases over two years - is too little.

Herman I. Liebling, a Lafayette College professor and a Treasury Department economic adviser, acknowledges that the package is modest enough "to have come from a Republican administration," but said the revival in growth in recent months justifies Carter's decision.

Most of Carter's advisers, such as Charles L. Schultze, chairman-designate of the Council of Economic Advisers, argue that it is easier to increase the size of the package if it proves too little than to scale it down if it proves too big.

Economists such as Kendrick and Okun said that the combination of an increase in sales and a decline in inventory accumulation virtually guarantees that businesses will have to produce not only to satisfy demand but even more to permit businessmen to add to their depleted stocks.

Alan Greenspan, President Ford's chief economic adviser, said that the economy should grow at a 6 per cent annual rate this quarter. If he is right there should be further increases in employment and reductions in the unemployment rate.

Over the past year, GNP rose 6.2 per cent, with much of that growth occurring before summer.

The inflation rate, measured by GNP statistics, accelerated from a 4.4 per cent rate in the third quarter to a 6.2 per cent rate in the fourth quarter. But much of that occurred because GNP accounting takes account of pay raises for federal employees, which boosted the inflation rate by at least 0.5 per cent.

There was also a slowdown in business investment which most economists think must pick up if the recovery is to strengthen during 1977. But Kendrick said it occurred because businesses bought fewer cars and trucks, not because factory and plant construction slowed. He noted that surveys by the Commerce Department and private firms indicate that business plans to boost investment spending this year.