The Senate approved a landmark revision of the nation's immigration laws yesterday that would grant amnesty to illegal aliens who entered the country before Jan. 1, 1980, and provide civil and criminal penalties for employers who knowingly hire illegal aliens.

The vote, which came after seven days of debate, was 69 to 30. Voting for the measure were 41 Republicans and 28 Democrats, including the senators from Maryland and Virginia.

The legislation now moves to the House, where a Judiciary subcommittee began hearings last week on its version.

Sen. Strom Thurmond (R-S.C.), chairman of the Senate Judiciary Committee, urged the House to move quickly. "I hope this time we can get a bill for the American people, as it is badly needed," he said.

The Senate approved immigration packages in 1982 and 1983. The House passed a companion bill last year, but it died in conference committee in the final days of the Congress.

This year, House Judiciary Committee Chairman Peter W. Rodino Jr. (D-N.J.) has played a bigger role by becoming chief sponsor of the bill and promising a timely hearing process. But House Majority Leader James C. Wright Jr. (D-Tex.) predicted yesterday that the bill would not make it to the floor until next year.

Final passage by the Senate was held up for more than two days when debate bogged down over an unrelated, nonbinding amendment by Sen. John Heinz (R-Pa.) to take the Social Security system out of the unified federal budget, arguing that the funds are separate and that the current Social Security surplus is making the federal budget deficit appear smaller. The Heinz amendment was in effect approved on a procedural vote of 79 to 20 not to table it.

The stalemate ended when Sen. Alan Cranston (D-Calif.) proposed a procedural maneuver that kept the immigration bill intact and sent the Heinz amendment to the Senate Budget and Finance committees with instructions to draft legislation by Nov. 3 to prevent cutting Social Security to reduce the federal deficit.

"This will protect senior citizens against raids on Social Security for the purpose of balancing the budget," Cranston said.

Sen. Alan K. Simpson (R-Wyo.), chief sponsor of the immigration bill, then asked senators to support the measure "if you agree with me it is a balanced and well-intended proposal. It is certainly a political 'no win' for any of you. I can tell you that."

The most controversial portion is a foreign workers' program, proposed by Sen. Pete Wilson (R-Calif.), to admit up to 350,000 agricultural workers to pick perishable fruits and vegetables. But it was modified to end the program in three years unless Congress revives it.

Rodino, however, has said he opposes the foreign worker provision and will work to keep it out of the House bill.

Wilson, who opposed the bill before he succeeded with the foreign workers' amendment, said he would support it because "I don't know of any alternative." But he said he doubted that it would effectively stop illegal immigration.

The Senate legislation is based on a system of civil and criminal penalties against employers who knowingly hire illegal aliens. Simpson, who has worked for six years on immigration revision, has said such provisions are necessary because most illegal aliens are drawn to the United States in search of work.

Employers found to be habitual violators could face six-month prison sentences and fines of up to $10,000 per alien worker.

The Senate adopted an amendment by Sen. Edward M. Kennedy (D-Mass.) providing that the employer sanctions could be phased out by Congress after three years if the General Accounting Offices finds that they cause "widespread" discrimination against Hispanics and others of foreign descent who are here legally.

A legalization program would be guaranteed within three years for illegal aliens who entered the United States before Jan. 1, 1980, and have lived here continuously. The government would provide up to $3 billion to the states over six years to offset the costs of social services.

Another major part of the legislation is an extra $16.7 million in funding for enforcement over a two-year period, with most going to the Immigration and Naturalization Service.