Social Security Commissioner Stanford G. Ross announced yesterday that he is quitting the government to join the law firm being formed by his close friend and former boss, Joseph A. Califano, Jr.

Ross, a Harvard law school classmate of Califano, worked with him in the Johnson White House in the late 1960's. They are personal friends and play tennis on weekends. Califano, secretary of health, education and welfare from early 1977 until he was fired by President Carter last summer, brought Ross in as commissioner of Social Security one year ago.

The job is one of the most important in the government, overseeing distribution of over $100 billion in benefits to 35 million Social Security pensioners and another $12 billion a year in welfare benefits.

Ross said the new law firm will be known as Califano, Ross and Heineman. The third partner is Ben W. Heineman Jr., who also worked for Califano at HEW. (Many others of Califano's "team" have also left or will soon leave.)

Before becoming commissioner, Ross was a tax and administrative specialist with the law firm of Caplin and Drysdale, and, according to a financial statement filed early this year, made $194,151 in partnership income from the firm in 1978.

Ross said he is leaving, effective sometime in December, because he always wanted to have his own law firm, and had viewed his role in government as that of a troubleshooter who comes in, helps solve a difficult problem and then goes. He said he had "absolutely no policy differences" with President Carter and HEW Secretary Patricia Robert Harris. However, he declined to endorse either Carter or Sen. Edward Kennedy (D-Mass.) in the presidential race.

Sources said Harris had sounded out former commissioner Robert Ball, who held the job for 11 years in the Kennedy, Johnson and Nixon presidencies, on whether he would be interested in taking it again, but he declined.