The rising stock market has been a boon to state and local government retirement programs, helping make investment earnings their major source of income, according to a government analysis released yesterday.

The Census Bureau reported that investment earnings became the source of the majority of the money coming into state and local government retirement systems last year.

"The stock market is up; everybody is helped by that if you have investments. That has to be a part of the answer," said Henry Wulf of the finance branch of the Census Bureau's governments division.

"It's been a favorable market. The fact that we fund public pension funds -- state and local government funds -- and put the money away in securities," has allowed the improving market conditions to boost income to the plans, said Vic Miller of the National Conference of Public Employee Retirement Systems, based in Columbus, Ohio.

"We've had kind of a steady, upticking market," said Miller.

The census study said earnings on investments made up 55.5 percent of the money flowing into state and local government retirement plans last year. That meant that of $88.1 billion in receipts in fiscal 1986, some $48.9 billion came from investments.

That share edged up from 48.6 percent in fiscal 1985 and was well ahead of the 37.1 percent that investment earnings contributed to state and local government retirement plans in 1981. In 1971, investment earnings contributed about one-quarter of the money received by retirement plans, the agency reported.

By comparison, employe contributions last year amounted to $10.6 billion, or about 12 percent of receipts. That was down from 13.2 percent the year earlier, 16.8 percent in 1981 and 28 percent in 1971.

The balance of income for the plans came from state and local government contributions, $28.6 billion or 32.4 percent. That's down from 38.2 percent in 1985 and 46 percent in 1981 and 1971.

While investments have constituted an increasing portion of the income of the retirement plans, actual money contributions from employes and government agencies have grown over the years.

Overall, the state and local systems reported assets of $437 billion at the end of 1986, up from $374 billion a year earlier and more than double the $210 billion in assets in 1981.

Payments to retired workers and withdrawals from the systems totaled $27.3 billion in 1986, up from $24.6 billion a year earlier.

That meant these systems received $60.8 billion more in 1986 than they paid out, compared with excess income of $47 billion a year earlier. The excess income can be invested to provide benefits for future retirees.

The average monthly benefit payment for 1986 was $537, up from $511 in 1985. Local retirement plans paid more than state plans, averaging $657 a month, compared with $504, the census agency's report said. In 1985, local plans averaged $647 a month, and state plans averaged $475.

Overall, the report looked at 2,580 retirement systems with 11.9 million participants. About 3.5 million people were receiving monthly benefits from the plans.

Investments held by the various plans were widely divided, with the largest share in corporate stocks, 30.9 percent. Other areas of investment were government securities, 27.3 percent; corporate bonds, 21.3 percent; mortgages, 7.2 percent; cash, 3.7 percent; and other securities, 9.5 percent.