Ronnie Baldwin, 20, a nursing student from Alexandria, Va., stopped by McCrory's variety store the other day looking for a job to help pay for his studies.

The store manager, Paul Laney, gave him a mix of good and bad news: no openings this week, but try again after the first of the month, when retirees escaping the winter will begin pouring into the city and increase his business.

Baldwin's experience tells a lot about St. Petersburg these days during a recession that has brought unemployment to its highest level since before World War II.

This sun-blessed city has felt the recession's impact in recent months, but far less than many other areas around the country, and not enough to undermine a feeling that St. Petersburg is exempt from hard times.

Unemployment in Pinellas County, which embraces St. Petersburg and several suburbs on the Gulf of Mexico and Tampa Bay, has risen to 6.4 percent, up from 5.4 percent a year ago. That means 20,100 people out of a job in a population of 743,000. But the number of employed also has risen by 7 percent to 293,000, and the unemployment rate still compares favorably with the 7.8 percent in all Florida and the 10.1 percent rate for the country.

A number of American cities similarly have escaped the recession's full wrath, each for its own reason. For example, at a time when U.S. unemployment is above 10 percent, it is 4.4 percent in the Raleigh, N.C., area and 6 percent in the Dallas-Fort Worth region. Other areas from Portland, Maine, to Denver also list themselves as bright spots on the mostly dark list of economic statistics for 1982.

The people of St. Petersburg count themselves lucky. Baldwin, for instance, already has a part-time job waiting on tables in a local restaurant and hopes to qualify soon as a full-time lifeguard for a nearby YMCA. Laney's store, in the center of town far from high-income shopping malls, is by his account "on an even trend."

"A doctor would look at that and he would not say the patient is dead, maybe that it needs some Geritol," said Jack Verson, research manager for The St. Petersburg Times and Evening Independent, talking about his city's economic health.

Economic analysts here say the city has resisted the national slump mostly because of an influx of high-technology industry in the past few years.

For years, St. Petersburg was only a resort for the wealthy, while Tampa on the other side of the bay was a bustling port. Then retirees started coming down from the Northeast, generating financial and service business but leaving the city free of any large-scale industry except construction.

"We just weren't discovered until a few years ago," said Paul Getting of the St. Petersburg Area Chamber of Commerce.

That was when high-technology companies started moving in with new plants in the mid-1970s. Most were attracted by a favorable business climate and the pleasant surroundings and low prices compared to northern cities. By the end of the decade, with electronics assuming a growing importance in the U.S. economy, the pace accelerated.

According to the Committee of 100, a business recruiting group, 90 companies began or expanded plants in Pinellas County from Oct. 1, 1979, to Sept. 30, 1980. The number for the following one-year period was 69. It was 55 for the period that ended last Sept. 30.

In the same time, no major companies shut down plants, according to specialists monitoring the Pinellas economy. About 500 persons were thrown out of work by a Westinghouse closure last year in neighboring Tampa, however, and several hundred will lose jobs in Woolco stores scheduled to close by the end of the year.

The influx of new factories helped increase the population by 44 percent to 1.6 million in 1980 in the St. Petersburg-Tampa area.

It generated a 72 percent increase in the number of housing units in the area, making construction a boom business.

Housing has dropped sharply in the last year, however. Home sales fell 36 percent this summer compared to last summer, and 55 percent fewer new home building permits were issued, the worst level since the mid-1970s.

Perhaps more disturbing to the specialists here was a recent decision by General Telephone and Electronics to drop plans to operate a plant that was to employ more than 1,000 persons within five years making switchboards.

The plant, a prime example of the kind of industry that has kept St. Petersburg prosperous, was built amid considerable fanfare, but never used. It now is empty and up for sale, a symbol of the economic troubles that may catch up with St. Petersburg.