MOSCOW, SEPT. 12 -- In midsummer, Mikhail Gorbachev approached one of the leading economists in his cabinet, Stanislav Shatalin, and asked him to head a committee that would draft a program designed to create the basic institutions of a free-enterprise system.

Shatalin, who had been thrown out of the Communist Party three times during the Brezhnev era for various heresies against the tenets of Bolshevik economics, was a man wearied by years of false hopes. "Look," he told the Soviet president, "is this just another matter of 'improving socialism' or creating a 'controlled market'? Because if it is, I'm a sick man and I don't have time left for such follies. But if you are serious now, I'm ready."

Gorbachev's decision Tuesday to endorse Shatalin's "500 Days" program marks a historic rejection of Soviet orthodoxy and a move toward the models of Western economic life. Until now, Gorbachev admitted, "our brains just could not handle this idea of a market." The decision, perhaps the most critical and dangerous of Gorbachev's five years in power, was a complicated mix of innovation and circumstance, of intellectual development and political pressure.

In his economic thinking, Gorbachev has gone from decades of working within the Stalinist system of centralized planning and collective farming to supporting a reform plan that calls for the privatization of nearly two-thirds of Soviet industry by 1992, the rise of commercial banking, a stock market and farms owned by farmers. There is to be a rapid sell-off of state properties, deep cuts in the budgets of the KGB security service, the Defense Ministry and foreign aid.

Gorbachev's abandonment of Marxist-Leninist conventions in favor of a reform based on the experience of the West is reflected vividly in his new reliance on Shatalin. Embracing Shatalin's vision of efficiency and practical free-enterprise economics meant rejecting, even humiliating, Prime Minister Nikolai Ryzhkov, who advocates a centralized, "controlled market."

In the coming weeks, members of the Supreme Soviet, or standing legislature, will debate and try to understand the "500 Days" program and make it their own. Gorbachev said the final version will include some of Ryzhkov's ideas, but Shatalin said the program is "99 percent" his. The Russian republic's legislature already has approved the Shatalin plan, and Gorbachev said today that the proposal now has been submitted to the 14 other republics' legislatures for review.Years of Growth

In the summer of 1948, Gorbachev won the Order of the Red Banner in the southern Russian village of Privolnoye for his prowess with a harvester in the wheat fields of the local collective farm. This summer, Gorbachev returned to his village scorning the old collectivist virtues, an advocate of free enterprise.

There a woman told Gorbachev that she looked after 50 cows on a collective farm but got almost nothing out of it. She would make a far better living, she said, if she were allowed to own just two cows and sell their milk in a free market. Disgusted that TV cameramen had failed to film this emblematic scene, Gorbachev lost his temper. "If you don't know how to do your job, then ask me," he scolded.

Gorbachev's road to his change of mind was gradual. He was never a closet free-marketeer. Of his tenure as a Central Committee secretary in charge of agriculture between 1978 and 1985, "the best that can be said," according to Swedish economist Anders Aslund, "is that he probably had very little influence."

But Gorbachev's unique capacity as a Soviet politician has been his willingness to learn and to reject what now are widely viewed as the illusions of his predecessors. Between 1982 and 1985, with Yuri Andropov and Konstantin Chernenko in power, Gorbachev was nominally in charge of the entire Soviet economy. He called on many reform-minded economists to help him think through domestic policy. He asked for reports not only on earlier Soviet reforms, but also on the land reforms of the czarist leader Pyotr Stolypin.

"Gorbachev realized we had been approaching the limits beyond which civilization could not survive," said Yevgeny Primakov, a member of the president's cabinet. "He began developing his ideas when he came to Moscow and brought them to the fore when he took power."

In 1984, Gorbachev ordered a team of reform-minded academics working in Novosibirsk, led by Tatyana Zaslavskaya and Abel Agenbegyan, to write a report on the realities of economic life. The report, a stunning portrait of a collapsing system, was instructive for Gorbachev, but it won Zaslavskaya a reprimand from local Communist officials when it was published abroad.

In "those years under Andropov and Chernenko you could see {Gorbachev's} growth," Agenbegyan said. "I could see how he began to acquire a sense of the economy. He mastered it."

At a Central Committee meeting in December 1984, Gorbachev spoke of the need for "revolutionary decisions" and "perestroika {restructuring} of economic management." He spoke in favor of competition, democratization and glasnost, or openness. The speech had the ring of a reformer's campaign manifesto. 'Irresponsible Ideas'

But Gorbachev, for all his political guile, showed no intention at the time of abandoning socialist ideals or the structures of a centralized economy. He seems to have intended to make socialism effective somehow, to create in the Soviet Union the dream that arose during Czechoslovakia's 1968 "Prague Spring" -- "socialism with a human face." Gorbachev's reform began with a singular model: Lenin's New Economic Policy of the 1920s, which provided a brief period of a limited market economy in the Soviet state.

The idea of a "socialist market" was revolutionary in Moscow -- except to some independent-minded economists, such as Vassily Selyunin. "Combining centralized planning and a market is the same as fixing a watch with parts of an hourglass," Selyunin wrote. "Both will be beyond repair, and that will be all."

Compared to his shifts in foreign policy, Gorbachev's economic reforms during his first five years in power were hesitant and at times -- as in the case of a failed anti-alcohol campaign -- disastrous. Gorbachev made attempts at creating what Shatalin jokingly called an economy "half pregnant" with market features.

The economic reform, such as it was, was going nowhere. People's expectations could not match the promises of the bold perestroika slogans. Black marketeers seemed to thrive as the length of lines at stores and the number of shortages increased. The old system was collapsing and there was little new to fill the gap. Boris Yeltsin, now president of the Russian republic, and others outside the Kremlin leadership accused Gorbachev of taking "half-measures."

Gorbachev appointed Shatalin to his cabinet in late March. But the Soviet leader was still not ready to take the plunge into the sort of free-market system that many were advocating. He rejected a plan for radical reform and, instead, endorsed a much more conservative program proposed by Ryzhkov's circle.

"They want us to take a gamble," Gorbachev said in a visit to Sverdlovsk last April. "They say, 'Let's have free enterprise and give the green light to all forms of ownership, private ownership. Let everything be private. Let's sell the land, all of it.' But I cannot support such ideas, no matter how decisive and revolutionary they might appear. These are irresponsible ideas." At a Dead End

The breakthrough, on the level of practical politics and ideas, came in May and lasted through the summer months.

Gorbachev was fast discovering that attempts to control the economy through traditional means had run out of support, both on the streets and in the legislature. Ryzhkov's original reform plan, which included a three-fold rise in the price of bread but little vision of privatization or decentralized authority, set off a surge of panic buying in late May and was finally rejected by the Supreme Soviet.

A week later, Yeltsin, campaigning on a platform of national sovereignty, was elected by the Russian legislature as its president, making him, in effect, the second most powerful politician in the country. Yeltsin quickly surrounded himself with young economists such as Grigori Yavlinsky, the author of an initial draft of the "500 Days" program. The huge Russian republic was saying, in effect, that it would no longer cooperate with a centralized economy.

Gorbachev began casting about for new ideas. Some of his closest and most radical Kremlin colleagues began speaking in the starkest terms of the ideological dead end in which they found themselves. "What is our greatness in?" Foreign Minister Eduard Shevardnadze asked at the time. "Territory? Population? Arms supplies? Or human misery? Lack of human rights? Poor living conditions? We have made our people, the entire nation, destitute."

On July 27, shortly before leaving Moscow for a working vacation in the Crimea, Gorbachev summoned to the Kremlin a group of radical-minded economists. At the meeting, he expressed fear of the social upheavals and resistance that radical reform was likely to cause. "My impression was that {Gorbachev} understands that there are even, or perhaps slightly better than even, odds of everything ending disastrously in the country," said Anatoli Strelyani, an economist who attended the session.

Strelyani also reported, in an unpublished account, that Gorbachev said he felt he was fighting not only the Stalinist system, but also the habits of mind the system had created. Gorbachev, Strelyani said, "deplores the well-known character traits of his countrymen -- to obey orders unquestioningly, to shun responsibility or risks, to put up meekly with hardships."

At the meeting, Gorbachev also indicated that he had finally abandoned the conservative forces in the party and was now ready to make joint cause with Yeltsin and the radicals who advocated a rapid transfer to a market economy. "We must prevent a split of the center-left, friends," Gorbachev declared in his parting words.

Strelyani left the meeting convinced that while Gorbachev had once believed in communism as an ideal, "he has learned much since then. A capable and tenacious student, he realizes now that nobody can find a better path than the one trodden by the West, though it will be tough and painful going."

On Aug. 2, Gorbachev and Yeltsin reached a crucial agreement -- a political "marriage" of sorts. They formed a joint committee, headed by Shatalin, to work out a new radical economic reform program that took into account the desire of Russia and nearly all other republics to control their economic destinies. Working in a wooded suburb of Moscow, Arkhangelskoye, Shatalin's committee thrashed out the "500 Days" program.

Gorbachev withheld his endorsement of the Shatalin plan until Tuesday, and even then he stunned his prime minister. Looking betrayed and rattled, Ryzhkov told reporters, "Until now, I didn't know Gorbachev was in favor of the Shatalin program."

On the floor of the Supreme Soviet, there were few illusions. The deputies knew, even though they had only read summaries of the Shatalin plan in the press, that they were about to consider a revolution of economics and ideology.

"We should tell the people that the Shatalin conception of a transition to the market is capitalism," said Leonid Sukhov, a deputy who was once a cab driver in the Ukraine. "We should hold a national referendum, and if the people accept this concept, okay, then let's go for this capitalism if life is better under it."

As for whether the plan will actually lead to higher living standards and an efficient market system, Shatalin had no answers -- or no definite ones. "In God we trust," he said.

The "500 Days" plan was drafted by a team of advisers to Boris Yeltsin, president of the Russian Republic, with the eventual cooperation of Stanislav Shatalin, one of Soviet President Mikhail Gorbachev's closest economic aides. The document outlines a strict timetable under which economic reforms would be implemented in stages.

The First 100 Days

Beginning Oct. 1: A "program of extraordinary measures" begins in the 15 Soviet republics, with:

The massive sale of state properties, unfinished construction projects and military properties used for civil purposes.

Radical land reform allowing farmers to withdraw from collective farms and receive "their share of the land."

Deep cuts in the federal budget deficit.

A 75 percent cut in foreign aid.

Cuts of 10 percent in the military and 20 percent in the KGB.

The sale of debts owed to the Soviet Union by other countries.

Beginning Nov. 1

Implementation of the first stages of a currency reform, intended to lead to the stabilization of the ruble and its eventual convertibility on world markets.

By Early 1991

Gradual, state-enforced price reform takes effect, though prices for staple foods products would be frozen or stabilized. Interest rates for bank loans are expected to increase, as is the number of state enterprises converted into joint-stock enterprises.

The state sells bonds and enterprises to further decrease the budget deficit. This would widen opportunities for individuals to buy, on credit, the property and means to open up small businesses, shops and restaurants. In this period, the plan calls for half of all small shops and restaurants to be privatized.

Days 250 to 400

"Stabilization of the market" is envisioned toward the end of this period, with up to 40 percent of fixed assets in industry, half in construction and automobile transport and 60 percent in trade and services out of state hands.

The Final 100 Days

A reasonably stable price system and state budget, a modern banking system and currency market are in place. The program also calls for the privatization of 70 percent of all industrial enterprises and 90 percent of construction and retail trade.

Compiled by James Schwartz