AEG-Telefunken, West Germany's second-largest electrical and electronics company, declared itself unable to pay its bills today and filed for receivership in a Frankfurt district court. It was the country's largest post-World War II corporate failure.

After months of financial brinkmanship, the company's senior managers acknowledged their failure to gain the confidence of potential corporate partners or bankers. This occurred despite a pledge by the Bonn government last month to extend $240 million in emergency export loan guarantees to the company, West Germany's 10th-largest employer and added to the mark's slide against the U.S. dollar.

On top of West Germany's mounting unemployment --already the highest seasonal level since records began here in 1950--AEG's action put into question the security of the company's 100,000 jobs in this country, plus 20,000 abroad. It coincided with the release of grim national statistics showing the deepest wave of postwar bankruptcies--5,676 in the first six months this year, a rise of more than 50 percent over the same period last year.

The electrical giant has been threatened by President Reagan's extension of sanctions against the planned Soviet gas pipeline to Western Europe. It has a $280 million contract to supply the Soviets with 47 gas-compressing turbines, using rotor-blade components that were to have come from General Electric in the United States. These rotor blades are blocked by Reagan's ban.

But AEG Chairman Heinz Duerr told reporters today for the first time that his company still intended to deliver the first two turbines for the Soviet pipeline in September. Duerr said the AEG-Kanis subsidiary in Essen that makes the turbines would not be slated for receivership under Telefunken's plan.

Although Telefunken is involved in numerous growth fields--such as information technology, electronics components and defense equipment--it has lost nearly $800 million in the past four years, largely as a result of poor performance in consumer electronics, where Telefunken lacks the volume to compete with large producers, and in household appliances, where recession and high interest rates have taken a heavy toll.

The company's voluntary court action today was one step short of a declaration of bankruptcy. In a letter to the work force, the company explained it had gone to court to seek a settlement with creditors so as to avoid the forced closure of all factories that a bankruptcy would involve.

Telefunken said it had been forced into a court settlement because of higher than expected operating losses this year and by the withdrawal of potential industrial partners from negotiations to divide up and salvage chunks of the company.

These developments caused some of the 24 banks that have been funnelling emergency aid to Telefunken to balk at a new credit of $110 million. Without this credit, the government had said it would not grant the emergency loan guarantees.

United Technologies of the United States and General Electric of Britain backed out of recent talks for a major share in Telefunken's capital-goods divisions. Plans to shed the company's hi-fi and television units face a stiff antitrust review.