Edward Kennedy last night launched five days of campaigning for next week's Maryland Democratic primary with appearances at fundraisers in Prince George's and Montgomery counties, which Kennedy's coordinators say he must win to carry the state.

In surroundings that were as different as the two counties' images, Kennedy spoke briefly to a crowd of jeans-clad, beer-drinking supporters at Prince George's Community College before rounding the Beltway to Rockville, where about 400 supporters sipped wine on a manicured lawn beneath a tan canvas tent.

The Massachusetts senator told both groups his campaign needs a victory in the May 13 Maryland vote. "In the next three and a half weeks," he said, "the direction of this country is going to be decided."

Kennedy's aides said he will campaign in Maryland four more days before the primary, including a full evening of stops in Baltimore tonight.

Several of his strategists said it is in Montgomery and Prince George's that they hope to run up the vote margins Kennedy will need to overcome Carter's presumed strength in the state's rural areas and in suburban Baltimore.

"If Kennedy can run even in Baltimore City and Baltimore County, we can win the state in Montgomery and Prince George's," said Prince George's County Council member Gerard T. McDonough, a Kennedy co-chairman in the county. "I think we need 55 percent of the vote in Montgomery," said Stan Gildenhorn, the county's central committee chairman and a Kennedy supporter.

Kennedy tailored his standard campaign remarks to the suburban vote by appealing to federal workers who, he said, were "the scapegoats of Carter's failed and flawed economic policies."

He also spoke of the high cost of college tuition for middle-class families and drew cheers in Montgomery when he spoke of "young professionals who are becoming a permanent renter class."

Both crowds, which organizers said contributed over $12,000 to Kennedy's campaign, were larger than their coordinators had expected, and Kennedy's aides said that a surge of interest in the Maryland primary seemed finally to be beginning.

"After weeks of laying back, all of a sudden everybody's getting interested at once," said Ann Lewis, one of Kennedy's key Maryland coordinators. "I think the campaign will finally heat up in this last week."

Nevertheless, in Prince George's at least, Kennedy's supporters were feeling the strain of stumping a county in a week.

"We're definitely seeing the effect of a long campaign," said McDonough. "Everyone is coming in here at the last minute and there's not a lot of time to put things together."

McDonough said Kennedy's campaign in Prince George's would consist of last night's fundraiser, deliveries of literature in 20 to 30 precincts, a telephone canvass and manning of the polls on election day. No more than about $3,000 would be spend during the week, he said.

Kennedy's Montgomery organizers plan a similar final effort, although probably more money will be spent. It is in Montgomery County, they say, that Kennedy has his best chance of winning.

Some of the supporters who came to cheer Kennedy in Montgomery apparently disagreed with at least one of his major points, that a president can control the nation's economy and international destiny.

One woman who said she supported Carter in 1976 noted that she does not blame the incumbent for the problems in the economy or for the Iran crisis, the major issues feeding voter dissatisfaction.

"Sometimes I wonder what one man can do," she said, adding that she still supports Kennedy. The same theme was echoed by many other Kennedy supporters in the crowd, but not by the senator.