Secretary of State George P. Shultz and Soviet Foreign Minister Eduard Shevardnadze met for nearly eight hours here today in what both sides described as a crucial prelude to the U.S.-Soviet summit meeting, which opens in Geneva two weeks from Tuesday.

Assistant Secretary of State Rozanne Ridgway said after today's meetings that Shultz is to hold talks with Kremlin leader Mikhail Gorbachev Tuesday afternoon and then will continue his meetings with Shevardnadze.

The talks with the Soviet foreign minister will go on "for as long as is necessary," Ridgway said. State Department officials said the length of time needed was so uncertain that Shultz might not be able to leave Moscow Tuesday night as planned, although "the current expectation" is that the talks can be completed by then.

U.S. and Soviet officials were tight-lipped in characterizing today's meetings, telling reporters in almost identical words that the two delegations are "in the middle of a conversation."

Ridgway said the two delegations of about 10 officials each spent a large part of the day in small "working groups" on a variety of subjects, which she declined to name.

She refused to say whether statements to be issued at the summit were being drafted in the groups.

The Soviet news agency Tass reported that the meetings concentrated "above all" on the nuclear and space arms negotiations between the two superpowers that are taking place in Geneva.

Prior to today's sessions in a Foreign Ministry villa near the center of Moscow, U.S. sources described the outcome of Shultz's mission here as highly uncertain because of the large differences between the two sides on arms control, at present the central question between Moscow and Washington.

Despite new arms proposals submitted by each side in the Geneva talks within the past month, a U.S. official said, "The positions are like black and white, and it is hard to see a shade of gray" that can produce accommodation at the summit.

A Soviet official said before today's meetings that despite four previous Shultz and Shevardnadze meetings since July to prepare for the summit, very little had been decided. "The real work is just beginning," the official said.

White House national security adviser Robert C. McFarlane, who participated in today's meetings, said Friday that he was hopeful that the summit would produce an understanding on arms control in the form of "a commitment by both sides to reductions and to a process of dialogue with respect to defensive systems."

It was not known, however, whether the Soviet side would agree to a very general statement of arms objectives in the absence of a U.S. commitment to some form of cuts on space weapons activity and specifically on Reagan's Strategic Defense Initiative.

Shevardnadze, Soviet Ambassador to the United States Anatoliy F. Dobrynin and other Soviet officials met Shultz and his party at Moscow's Vnukova Airport this morning. "Welcome," said the Soviet foreign minister, in one of his few words of English.

Shultz, in a brief arrival statement, pledged to "prepare thoroughly and carefully" for the Reagan-Gorbachev summit.

Today's formal talks gave way to a working luncheon hosted by Shevardnadze, then reconvened and continued in working groups or general sessions.