President Reagan today defended his frequent trips to his California ranch as a necessary retreat from the cares of the presidency.

He talked of physical enjoyment of doing chores at the ranch and said he prefers his 1,500-square-foot ranch house or the "normal-size house" at Camp David, Md., to living in the White House, where "you can get a kind of a bird-in-a-gilded-cage feeling."

The isolation of the ranch in the Santa Ynez mountains 30 miles west of here also agrees with him, Reagan indicated.

"When you get in there . . . the world is gone," he said.

The president discussed ranch life in an interview published today in the Santa Barbara News-Press. It was conducted by Jerry Rankin, who has written frequently about Rancho del Cielo, the president's mountaintop retreat.

Reagan has spent all or parts of 171 days at the ranch during his presidency, about 12 percent of his time in office. He returned to Washington today after five sunny days at the ranch.

After the Soviets created an international incident in September 1983 by shooting down a South Korean airliner, Reagan resisted entreaties of his staff to return immediately to Washington.

Reagan reflected the same view today, saying that he can perform his duties wherever he is and citing the need of previous presidents for getaway places.

"I think Nancy put it once better than anyone else: 'Presidents don't get vacations; they just get a change of scenery.' And you're still president," he said. "The job goes with you."

Reagan dismissed complaints about the trips' multimillion-dollar costs, saying that Air Force One must be flown a certain number of hours each month and that most of the cost for security and salaries would be paid anyway. The White House, following the practice of other administrations, has declined to make public the cost of the trips.

Despite Reagan's fondness for the ranch, he said it would be "too secluded" to live at full time. He said he expects that after his second term he and Nancy will live in Los Angeles and vacation at the ranch.

Asked whether he had considered living in Palm Springs, Calif., where the Reagans usually spend their New Year's holiday, the president replied: "I've never been a great aficionado of the desert."

Reagan told many tales of ranch life. He said he and the ranch foreman had collected more than 120 water snakes in paper bags one year and, rather than slaughter them, had dumped them in a small lake that they dubbed "Snake Lake."

On one occasion, Reagan said, when he had to leave the ranch hurriedly and there was no time to go to the lake, he surprised the First Lady and two Secret Service agents by taking a bag of snakes in his limousine and dumping them on the roadside.

Reagan also told a snake story from earlier years, when actor Robert Taylor and his family visited at a ranch he then owned in Malibu. They spotted a rattlesnake, which Reagan unsuccessfully tried to kill with a stick.

"I always at the ranch wore boots and britches, English-type boots, and I knew you can be pretty brave about snakes with those boots on," Reagan said. "There's no way they're going to get through those boots, and they're not going to strike that high. So the stick broke and . . . I stomped on his head with my heel and then looked down. I had sneakers on."

Reagan said he no longer has cattle on his ranch, observing that, because it is a "hobby ranch," he would no longer get a federal tax break for doing so and also saying he is away too much to do so. He still enjoys a property tax break, however, because the land is designated "agricultural preserve" under a state law designed to protect open spaces from being divided into subdivisions.

The ranch, like half a million other acres in Santa Barbara County, was in this category when Reagan purchased it in 1974.

In the interview, Reagan also offered a familiar defense of oil drilling in the Santa Barbara Channel, saying it was ultimately environmentally beneficial because scientists had determined that the channel bottom was "badly fractured" and that the best thing to do was to remove the oil there.