The Challenger astronauts scored another major first today when they launched a satellite and flew in formation with it for six Earth orbits while repeatedly retrieving it with a mechanical arm and finally returning it to the space shuttle's cargo bay.

Astronauts Robert L. Crippen, Frederick H. Hauck, John M. Fabian, Sally K. Ride and Norman E. Thagard flew in formation for eight hours with a satellite built by a West German aerospace company, Messerschmitt-Bolkow-Blohm, while cameras aboard Challenger and the German satellite recorded the spectacular exercise on film.

Carried out 180 miles above the Earth, the maneuvers were no mere exercise in space. The astronauts were, in fact, rehearsing for the 13th space shuttle flight late next year. Its crew will retrieve a damaged satellite called the Solar Maximum Mission, pull it back into the cargo bay, repair it and put it back to work in space again.

Looking for all the world like a flying bedstead or a wrecked car in orbit, the 15-foot-long German satellite was lifted out of the cargo bay with the shuttle's 50-foot-long mechanical arm and let go in space just after 3 a.m. More than 10 hours later, astronauts Fabian and Ride used the mechanical arm to haul the 3,200-pound satellite back from space a final time and lock it up inside the cargo bay.

Though the astronauts are still scheduled to return to earth Friday and make the first spacecraft landing ever at the Kennedy Space Center in Florida, there was concern today that poor weather could force a postponement until Saturday or even Sunday. The weather was so uncertain that President Reagan canceled his planned visit to the space center.

Thick morning clouds have covered Cape Canaveral and surrounding beaches for the last two days and thunderstorms dumped more than four inches of rain on the region Tuesday night. The forecast is for more morning overcast on Thursday, with a chance of clearing Friday morning or Saturday at the latest.

Challenger has enough air, water, electricity, food and fuel to stay in space until Sunday or even Monday. Flight directors want this seventh shuttle crew to land in Florida rather than at California's Edwards Air Force Base.

Most shuttle flights will begin and end in Florida, starting with the delayed tenth flight now scheduled for early next year.

Landing the spaceliner in Florida will save time and money; it takes eight days to fly a space shuttle on the back of a modified Boeing 747 airliner from Edwards to the Kennedy Space Center to be refitted for its next flight.

In the 10 hours that the German satellite was outside Challenger's cargo bay today, it flew on its own for eight hours and moved as far as 1,000 feet away.

Illuminated by its own lights on the night side of the Earth, the satellite looked like part of a scene from the Walt Disney movie "Tron," in which people's bodies glow from within.

On the day side of the Earth, the satellite and the shuttle looked as if they were right out of "Star Wars." The astronauts in space and their colleagues on the ground at the Mission Control Center in Houston sounded like adolescents at an amusement park.

"Beautiful!" astronaut Guy Gardner said when the first televised pictures of the free-flying satellite came down to Mission Control.

Replied pilot Hauck from space: "You've got five very happy people up here."

Answered Gardner: "Sounds great, Rick. There are several thousand happy people down here."

The only trouble the astronauts experienced while flying in formation with the satellite was in keeping the satellite's instruments cool in the sun's relentless heat. Once, the temperature rose to more than 210 degrees Fahrenheit, forcing the astronauts to rendezvous with the satellite, secure it with the robot arm and place it in the shuttle's shadow to cool off.

The astronauts took turns releasing the satellite from the arm and letting it fly on its own at least four times before ending the exercise at 1:38 p.m.. Not only had the crew deployed and retrieved a satellite for the first time in space history, they had allowed eight German experiments on the satellite eight hours of free-flying time in space.

"We've been told that past crews have said they deliver," Commander Crippen said in reference to the fifth shuttle crew's boast that they "delivered" when they deployed the two communications satellites from the shuttle last November.

"Well, this crew picks up and delivers," Crippen said.

So sure were the astronauts that they could handle the satellite with the robot arm and approach it without fear of striking it that they twice fired their small onboard engines to see how the exhaust gases would affect the satellite.

Once, when the upward-pointing engines at the rear of the shuttle were fired, the blast sent the satellite tumbling faster than flight directors thought it would.

"We weren't sure we were going to get that kind of motion," flight director John Cox said late today at the Johnson Space Center in Houston. "That's something we're going to have to take a look at."