Secretary of State George P. Shultz said today that U.S. relations with Greece's Socialist government have taken "a real turn for the better" during his two-day visit here, despite the lack of any new accord on whether four U.S. military bases will be allowed to remain in Greece.

Shultz said at a news conference that he and Prime Minister Andreas Papandreou had agreed during a 3 1/2-hour working lunch to "serious discussions" on the bases "in time for an orderly resolution of the issue well prior to December 1988," when the current basing agreement expires.

"I have found the discussions quite satisfactory," Shultz said. He added that he had felt "great encouragement" in his talks with Papandreou about "broadening and deepening our cooperation" against international terrorism.

Shultz's apparent contentment with the fruits of his visit is likely to dismay many of Papandreou's leftist supporters, who are usually happy to hear the prime minister defending Libyan leader Muammar Qaddafi and promising to get rid of U.S. bases.

But Papandreou has taken a moderate tone during Shultz's heavily guarded stay. "We have resolved a number of important issues," the prime minister said after their lunch. "He has been open and clear . . . . I will be very glad to see him again."

The cordial tone was paradoxically stronger in nominally hostile Greece than it was in nominally friendly Turkey after Shultz's three-day stop there earlier this week. The Turks, whose agreement on 15 U.S. bases is also under discussion, demanded new trade concessions and a stable aid level to help them modernize their armed forces. The Greeks appeared to offer at least the first few leaves of an olive branch.

In neither country, however, was there any conclusive outcome to the main issues of the trip, which in both cases revolved around the status of U.S. bases, the division of Cyprus between Greek and Turkish troops, and the strains in NATO that result from Greek-Turkish animosities.

Shultz said he hoped Greece "would be able to find a way" to resume full participation in NATO, indicating that there had been no movement. Greece withdrew its troops from NATO exercises last year in a dispute with Turkey over Greek troops on the island of Lemnos.

On his way here, Shultz was firm on his determination to find out before investing more money in the U.S. bases here whether future negotiations on them would involve the terms for extending their stay or the timetable for their departure. "We did not come to a conclusion," he said today.

He is scheduled on Friday to visit the U.S. base at Hellenikon, outside Athens, to meet with the commanders of all four military facilities. The Hellenikon site has been the focus of countless anti-American demonstrations and security headaches, and is considered by U.S. officials to be a prime candidate for closing as a possible future concession to Papandreou's domestic political requirements.

But Shultz listed "a record of achievement" for the Athens stop, including the concluding of arrangements to sell 40 U.S. F16 jets to Greece, an agreement to protect shared military information and a new civil aviation pact. None of these have been controversial here.

Some of the good will may have been dissipated with a slip of the tongue by State Department spokesman Bernard Kalb. Closing the crowded news conference, he said there would be time "for one more question, somebody from the Turkish press." The questioner, after giving his name, said pointedly, "from the Greek press." The exchange drew a rare grin from Shultz at Kalb's embarrassment.

Asked the source of the new Greek atmosphere, Shultz referred to Papandreou's promise during last year's reelection campaign that he would seek "calmer seas" for his relationship with Washington. "The president picked up on that signal. We tried to devise a systematic, operational way of finding our way into calmer waters, and a lot of things have happened," Shultz said.

Although Shultz did not mention Greece's ailing economy as a reason for the change, better relations with Washington could help in that regard. The Greek tourist trade, a major source of the country's income, suffered severely last year after the Reagan administration issued a warning in June that the Athens airport was not secure from terrorism.

Despite hurried improvements and a lifting of the U.S. warning, tourism from the United States is still lagging as the high season begins.

Asked at the news conference if Greece is now safe for American tourists, Shultz said, "Yes." He did not elaborate.