The surprise resignation of France's star television news anchorwoman has stirred suspicions here that the Socialist government is attempting to reassert controls over the electronic media prior to crucial elections next year.

The announcement that Christine Ockrent, a 41-year-old U.S.-trained journalist, was stepping down as anchorwoman for the country's most widely watched television news program was greeted this week with the kind of fevered speculation usually reserved for major government shake-ups. The controversy was promptly dubbed l'affaire Ockrent in the best tradition of French political sagas and scandals.

In a country where television traditionally has been regarded as the voice of whatever government happens to be in power, Ockrent had become a symbol of a more detached and professional attitude toward the news. During the past 3 1/2 years, her evening news program on Antenne 2 consistently has won top audience ratings over its principal rival, TF1, widely regarded as being closer to officialdom.

Ockrent's winning smile and brisk, authoritative manner shot her to stardom when she became the first woman to anchor a prime-time television news show in France in 1981. She was baptized "Queen Christine" by the popular French press and consistently was rated in the opinion polls as the country's most popular television news personality.

"They wanted to prevent her from governing: Queen Christine preferred to abdicate," was how the right-wing Le Figaro summed up her resignation this week. The independent leftist newspaper Liberation said that her departure was a sign that President Francois Mitterrand's Socialist government was unhappy with the independence displayed by Antenne 2's news team.

In public statements, Ockrent attributed her resignation to "professional" differences of opinion with Antenne 2's newly appointed director general, Jean-Claude Heberle, over staff appointments. A former television journalist himself, Heberle is believed to be close to the Socialist Party and is known as the author of a friendly documentary about Mitterrand while the Socialist leader was still in the opposition.

"It is not possible for me to continue as I no longer feel in tune with my superiors," Ockrent said in an interview in which she went out of her way to praise Heberle's predecessor, Pierre Desgraupes, who built a reputation for upholding journalistic independence and turning Antenne 2 into the country's most respected network.

As with many French media controversies, the "Ockrent affair" is more complicated than appearances might suggest. Political influence over the mass media is wielded in subtle ways in France -- through personal connections rather than overt manipulation of information -- and it is difficult to point to examples of outright interference in editorial decision making.

Some French journalists claim that Heberle, whom they depict as a "little Napoleon," is seeking to bring Antenne 2 under tighter political control by placing his own trusted men into key slots. They accuse the new director general of seeking to bypass Desgraupes appointees such as Ockrent and Albert du Roy, the former head of the network's news department who also resigned recently for "personal reasons."

Others see the conflict in terms of a clash between two strong-willed and ambitious personalities: Ockrent and Heberle.

Reacting last week to Ockrent's resignation, Heberle described allegations of political interference as "unjust," saying that he never had sought to bring any kind of political pressure to bear on the news department. He initially threatened to sue his former star newscaster for breach of contract but later backed down.

With important legislative elections due to be held in a year, the Socialists have every interest in seeing that their message gets across in the media. Prime Minister Laurent Fabius has been given a weekly 15-minute slot on TF1 to explain government policies, and there has been a significant reduction of unauthorized leaks to the press.

According to the investigative weekly Le Canard Enchaine, suspicions of Heberle's left-wing political connections surfaced at Antenne 2 in January after a visit by Mitterrand to the troubled French Pacific island of New Caledonia. The director general was reported to have staged an angry scene after editors at the network -- in the interest of brevity -- decided to cut parts of Mitterrand's statement on returning home.

The present turmoil at Antenne 2 contrasts with the mood of optimism and self-confidence after the Socialist election victory in May 1981, when the network took advantage of the government's decision to relax controls over the electronic media. The changes introduced in news presentation by Ockrent, who previously worked on the CBS program "60 Minutes" under Mike Wallace, were hailed here as the advent of le style Americain in French television.

"I tried to be a credible anchorwoman, bringing the treatment of the news closer to the facts and away from the caricature of French blah blah blah. We tried to develop a more rigorous approach to the news -- giving it more punch and attractiveness," Ockrent said.

In contrast with many of the stars of French journalism, Ockrent says she deliberately avoided the company of French politicians. She likes to boast that she has only met Mitterrand twice -- once when she interviewed him for the nightly news and once at a breakfast attended by a dozen other journalists.

The Socialist government's claims that it has taken a more liberal attitude toward television than its conservative predecessors rest partly on the creation in 1982 of a High Authority for the Audiovisual Media. Although it is theoretically an independent body, the authority's standing was tarnished somewhat last year when it succumbed to government pressure to appoint Heberle as head of Antenne 2.