CLAYTON, Mo. (AP) _ General Dynamics Corp., a leading defense contractor, said Monday that it lost $326.1 million in the fourth quarter and $52.5 million for all of 1986, largely because of the cost of purchasing Cessna Aircraft.

For comparison, the company had reported a profit of $90.4 million, or $2.13 a share, for the fourth quarter of 1985 and earnings of $383.3 million, or $9.05 a share, for the full year.

Sales for the quarter rose 9.1 percent to $2.38 billion from $2.19 billion in 1985. Sales for the year were up 12 percent to $8.89 billion from $8.0 billion in 1985.

The discontinuation of its Quincy Shipbuilding and Datagraphix operations also affected the results, the company said.

Excluding the effect of the company's charge to earnings for Cessna, it said earnings from continuing operations edged up to $85.6 million in the fourth quarter from $82.2 million a year earlier, and slipped to $356.7 million for the full year from $361.1 million in 1985.

Stanley C. Pace, chairman and chief executive, said Cessna's operating earnings were at the break-even point during the fourth quarter and were significantly better than in any of the three previous quarters.

''While the seasonality of the industry contributed to this improvement, we also believe that the actions taken during the quarter in response to the depressed conditions of this market will contribute favorably to 1987 results,'' Pace said.

He said the company's major defense business segments ''reflect a steady performance, and our programs remain at the heart of U.S. strategic and tactical military planning into the next century.''