Thousands of disabled Americans facing challenges to their right to continue receiving Social Security disability benefits could lose them if Congress fails to renew a law extending benefits under appeal.

As many as 20,000 people could be affected next year.

Health and Human Services Secretary Otis R. Bowen said in a letter to congressional leaders that people already on the rolls, who are ruled no longer eligible, are allowed under the expiring law to continue receiving benefits until their appeal to an HHS administrative law judge is decided. But he warned that the law expires Dec. 31 and must be extended to avoid hardships.

Under existing law, benefits continue until the administrative law judge makes a ruling, which can take seven months or longer, Social Security officials said. Without this provision, all benefits are normally cut off two months after the initial Social Security Administration ruling that the individual is no longer sufficiently disabled to receive benefits.

Under the Social Security program, an individual under 65 who is too disabled to hold any job, is eligible for monthly disability benefits if he or she has been working and paying the Social Security payroll tax. This year, about 2.8 million workers and 1.2 million of their spouses and children are receiving monthly benefits. As of August, the average benefit for a disabled worker was $487.50, not including dependents' benefits. After two years on the rolls, a disabled worker is also eligible for Medicare benefits.

The government reexamines people on the disability rolls periodically to determine whether they are still eligible for benefits. Thousands of people are initially ruled no longer eligible but two-fifths to one-half are restored on appeal.

To avoid undue hardship, Congress voted in the early 1980s to allow people to receive benefits during the appeal period. If eventually ruled ineligible, recipients must repay the cash benefits for that period.

"In the absence of congressional action the current provision will expire on Dec. 31, 1987," Bowen said in letters to the Senate and House leadership. "If the provision is not extended by Dec. 31, I will unfortunately have no recourse under the law but to eliminate these interim payments."

Bowen said he had asked Congress last May to extend the provision, and the House had "included this proposal in its budget reconciliation bill. To date, legislation has not been introduced in the Senate to extend this important expiring authority."

An aide to Sen. Daniel Patrick Moynihan (D-N.Y.), chairman of the Senate subcommittee on Social Security, said he plans emergency action if needed to make sure the provision is extended.

Congressional aides said, however, that there are procedural hurdles to putting it in the Senate's reconciliation bill, currently the most attractive solution. The expiring provision was written into the disability law after the Reagan administration, stepped up the number of reexaminations of people on the disability rolls to comply, it said, with a 1980 directive from Congress.