WASHINGTON (AP) _ Federal, state and local governments spent $592.6 billion for social welfare programs in fiscal 1982, or 19.3 percent of the Gross National Product, a study says.

That was up by $42 billion, or 7.6 percent, from the previous year, primarily due to the growth of Social Security benefits and Medicare, according to the report by a Social Security Administration researcher.

The federal government claimed a 62 percent share of the social welfare spending, or $366.6 billion. The largest component of the $226 billion state and local share was education, which cost $122 billion.

Ann Kallman Bixby of Social Security's Office of Research, Statistics and International Policy, said that in constant dollars - taking inflation into account - real spending on social welfare rose only 1.7 percent from 1981 to 1982, reflecting a slowdown that began in 1976.

Social welfare expenditures represented 8.2 percent of the GNP in 1950 and grew steadily to 19.3 percent in 1976. They have fluctuated around that level since then.

''Before 1976, social welfare expenditures were characterized by rapid growth,'' she wrote in the December issue of the Social Security Bulletin. ''After 1976, social welfare spending slowed.''

Programs such as Aid to Families with Dependent Children, Supplemental Security Income, Medicaid and food stamps accounted for less than 14 percent of the total social welfare spending, she said.

Meanwhile, a research foundation is offering a $5,000 prize for the best blueprint for consolidating the nation's dozens of welfare and social insurance programs.

The Institute for Socioeconomic Studies said it will also pay $2,000 and $1,000 prizes for the second and third best articles.

Leonard M. Greene, president of the research organization in White Plains, N.Y., said the ''intractable deficits in the federal budget have been racheted up by the uncontrollable costs of public assistance and social insurance.''

''Piecemeal tinkering trying to hold costs down isn't worth the time Congress gives wrangling about it,'' said Greene.