The Senate Finance Committee, working on a $165 billion Social Security rescue bill, voted 13 to 4 yesterday to raise the retirement age to 66 and slightly reduce the basic benefit early in the next century.

As part of the same amendment, the committee agreed to a proposal by Sen. William L. Armstrong (R-Colo.) to eliminate the $6,600 earnings limitation for retirees and to guarantee that women who take up to two years off from work for childbearing would not have reduced Social Security benefits as a result.

The provision the committee approved as it headed for a final vote on the bill differed from an age change the House voted Wednesday night. The House provision would raise the retirement age from 65 to 67 in the next century and did not include the other three features of the Senate committee's amendment.

Earlier in the day, the committee voted 10 to 6 to include new federal employes in the system, starting next year.

The plan, passed by the House Wednesday, was recommended by a presidential commission Jan. 15 with the endorsement of both President Reagan and House Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.).

Reagan invited O'Neill and other House leaders to the White House yesterday to congratulate them on passage of the compromise.

At nightfall the panel approved and tacked onto the bill a provision, also passed by the House, altering how the government reimburses hospitals under Medicare. Under this payment plan, rates would be fixed in advance for various services; hospitals whose costs were higher would have losses, those that kept their costs lower would gain.

An amendment by Sen. Russell B. Long (D-La.) that passed 12 to 3 would require automatic cuts in the annual cost-of-living increase after 1984 whenever trust fund reserves dipped below 20 percent and continued downward, if Congress took no emergency action and if interfund borrowing could not remedy the situation. The cost-of-living increase would be cut first for people receiving $250 a month or more in primary benefits.

Also approved, 11 to 4, was a proposal by John Chafee (R-R.I.) to include tax-exempt income of retirees in the calculation of whether they reach the $25,000-a-year plateau that would make their Social Security benefits subject to taxes. The tax-exempt income itself would not become taxable but would only be used in the plateau calculation. Another major change by the committee substantially increased a new system of tax credits for the self-employed to compensate them for higher Social Security taxes imposed by the bill.

The major Social Security provisions would postpone this year's cost-of-living benefit increase from July 1 until next January; accelerate Social Security tax increases already scheduled for 1985 and 1990; impose the federal income tax for the first time on half the benefits received by higher-income Social Security recipients, and extend Social Security coverage to all federal employes hired from next Jan. 1 on.

Long proposed to defer this coverage until Congress creates a supplementary retirement system for those who would be affected. But his amendment was defeated 10 to 6.