Two astronauts stepped out of the space shuttle Challenger 177 miles above the Earth today and took America's first walk in space in more than nine years.

Astronauts Story Musgrave and Donald H. Peterson moved out through an airlock just after 4 p.m., Washington time, as the Challenger orbited the Earth at 17,500 mph. They attached themselves to 50-foot slide wires and moved like underwater swimmers up and down each side of the shuttle's 65-foot-long cargo bay, testing the new space suits, handholds, footholds, tools and ropes that later shuttle crews will use to repair and maintain spacecraft. Apparently effortlessly, Musgrave and Peterson spent three hours and 52 minutes outside the space liner while commander Paul J. Weitz and copilot Karol J. Bobko watched from the shirtsleeve atmosphere inside the cabin.

Moving hand over hand down the slide wires toward the tail of the space liner, Musgrave and Peterson were photographed over television on Challenger's 51st, 52nd, and 53rd revolutions of the Earth. The first time they were moving over Mexico with the Pacific on one side and the Gulf of Mexico on the other. They looked like Lilliputians against the wide expanse of the Earth.

"We're looking right at you, Story," astronaut Jon McBride called up as Musgrave's visored face suddenly appeared in front of one of the TV cameras. "Got a good shot of Mother Earth right behind you."

"I see you, too," Musgrave replied as he put two fingers of a gloved hand up close to the camera and waved them.

Often out of radio contact with Earth and frequently working under floodlights on the night side of the Earth, Musgrave and Peterson stepped through a whole range of practice tasks that included using wrenches and winches to test procedures for working in space. They had trouble at least once using a winch and rope in an exercise to close the payload bay doors should they not close automatically.

"We can't get any slack on the line at all," Musgrave said as the two crewmen tried to loosen up the tension on the rope in space. "We've been through all the usual fixes, and none of them seems to work."

After about 10 or 15 minutes of moving from one side of the cargo bay to the other, the astronauts finally did something that took the tension out of the rope. "Good work!" one called to the other. "But be careful with your feet."

Whoever got the rope and winch to work had suddenly seen his feet float up and behind him, a position in which his feet might get dangerously tangled in the slide wires.

The spacewalk was the first by Americans since astronauts Edward Gibson and Gerald Carr stepped outside the Skylab space station in February, 1974, to retrieve film from an exterior camera.

Before Musgrave and Peterson stepped outside, they spent three hours in their spacesuits breathing pure oxygen to wash the nitrogen out of their blood. This was done so they would not get the "bends" that divers get when they come out of the water too fast after being on pure oxygen under the water.

Musgrave and Peterson made spacewalking look easy, but earlier spacewalkers have said it is tiring and difficult work to maintain balance and move arms and legs in the absence of gravity.

Just before the spacewalk, President Reagan placed a radio call from the White House through mission control to the astronauts. "Just please know that all of us, the American people, are proud of your service to your country and what you're doing," he said.

While Musgrave and Peterson were space walking, flight directors on Earth at White Sands, N. M., were postponing plans to bump into a higher orbit the errant Tracking Data Relay Satellite that had been rescued from a near disaster in orbit on Tuesday. The 5,000-pound satellite was stable and performing well in a deliberate slow roll to maintain an even temperature around its antennas, electronics package and solar panels.

One of four thruster engines that are used to roll the spacecraft was not working properly and another was showing signs that it was about to fail. Flight directors said today they wanted to fully understand why the roll thrusters were misbehaving before they used other thrusters to even out the satellite's orbit.

They plan to try raise it to "geosynchronous" orbit, a path 22,335 miles above the Earth, where the satellite can match the Earth's rotational speed and stay in the same relative position all the time. Its current orbit takes the satellite as close to the Earth at 13,540 miles, a position that lets the satellite drift more than 100 degrees to the east every day.

By late today the plan was to start maneuvers that will raise the satellite's orbit in about a week or 10 days.