International Harvester Co. announced today that it has reached an agreement with its nearly 200 bankers to stretch out repayment of $3.45 billion in short term debt.

The complicated agreement, which took nearly a year to put together, should keep the nation's biggest manufacturer of heavy duty trucks out of bankruptcy, at least for the foreseeable future.

The bankers agreed to let Harvester repay the loans over the next two years and also agreed to pump up to $750 million more into the company by purchasing loans made by Harvester's credit subsidiary. But negotiations went down to the wire. Several of Harvester's smaller creditors agreed to sign the accord late Tuesday, less than 24 hours before the deadline.

Harvester Chairman Archie R. McCardell said at a press conference today he believes that the total $4.2 billion refinancing package is the largest private one ever negotiated.

The agreement is designed to give Harvester the breathing room it needs until its major customers--truckers, farmers and heavy construction companies--emerge from the recession that his gripped them for nearly two years.

"It's a good company. They've got good products," said an official of one Harvester lender. "When its markets comes back, Harvester will be all right."

However, McCardell, who appeared at the press conference in shirt sleeves, said Harvester is not relying on a turnaround in demand for its products to return to profitability.

He said that the company plans further cost cutting so that it can operate profitably even if sales of its products are 30 percent lower than they were in the late 1970s.

McCardell, who has run Harvester for four years, said the company anticipates a big loss in its first quarter (which ends January 31) because of massive plant shutdowns to reduce inventories. He said he expects it to return to a profitable operation soon after that. He told reporters the forecast is based on a worst-case scenario in which sales declined another 10 to 15 percent from last year, although he said he anticipates an improvement in sales, mostly trucks.

McCardell said the company plans to cut more white collar workers in the months ahead, sell some assets, such as a $35 million test track in Phoenix, consolidate manufacturing plants and eliminate some product lines that are unprofitable or less profitable than the company thinks they should be. Harvester also has asked the United Auto Workers to give it wage and benefit reductions totaling $100 million in 1982.

Harvester, last year the 49th biggest industrial company in the country, started to have problems in November 1979 when it decided to take a strike by the UAW. By the time the strike was settled 172 days later, sky-high interest rates had devastated Harvester's major buyers. Besides trucks, the company is the nation's second-biggest maker of farm equipment and an important producer of heavy construction equipment.

When the strike began, the company had $450 million of short term debt. By the end of the strike, the debt was more than $1 billion and it climbed to $3.45 billion this year. The parent company owes $1.5 billion of that and the credit subsidiary owes about $2 billion.

In fiscal 1981, Harvester lost $636 million on its continuing operations. It had revenues of $7 billion. Because it sold its Solar Turbine Division to Caterpillar Tractor Co. for a $275 million profit last spring, the company's net loss last year was $393 million. In fiscal 1980 (Harvester ends its accounting years on Oct. 31), the company lost $397.3 million on sales of $6.3 billion.

The company was founded in 1831 by American inventor Cyrus McCormick. But it had to shelve plans for an elaborate celebration of its 150th anniversary this year because of its financial plight.

Instead, the company tightened its belt and laid off workers. About 10,000 of its 36,000 union workers are on permanent layoff and another 20,000 are now temporarily out of work until at least Jan. 4. The company shut down virtually all its plants Dec. 14 until after New Year's because of slack demand for its products.