The House overrode fierce Republican opposition yesterday and approved the most sweeping overhaul of the welfare system in decades, stressing training for welfare families, particularly teen-age parents, that would enable them to get jobs.

The measure, approved 230 to 194, now goes to the Senate, where it is expected to face formidable obstacles.

The Democratic-sponsored bill would cost $5 billion over five years and provide an additional $700 million for food-stamp program improvements. It would require the states for the first time to set up large-scale job training, education and work programs, designed to shift low-income families with children off welfare rolls and into paying jobs.

Under the bill, any welfare parent whose children are 3 years of age or older could be required to participate in the training and work programs. Parents with children between one and three could be enrolled in the programs with federal approval. Appropriate child care would have to be financed by the states.

The participants would be allowed to continue receiving benefits while completing their high school education. In some cases, they could also take advanced courses.

The Congressional Budget Office estimated that 5,000 people a year would find work and leave welfare rolls after participating in the program.

States would receive automatic federal support for the job-training effort at a basic rate of 65 percent of whatever they spent.

At present, training and work requirements are minimal for the 3.8 million parents and their 7 million children receiving Aid to Families with Dependent Children benefits.

After yesterday's vote, Rep. Thomas J. Downey (D-N.Y.), chief floor manager of the bill, said, "The poor children of this country have something to celebrate . . . . We have finally recognized two things -- that the welfare system is broken and needs repair, and that an effort of this sort is necessary to repair it."

But Rep. Hank Brown (R-Colo.) charged that despite its good intentions, the Democratic bill is "anti-work, not pro-work."

Gary Bauer, President Reagan's domestic policy adviser, said, "The American people, particularly the poor, are ill served by a poverty bill that ignores the deficit, fails to require work for benefits, does nothing to reduce dependency and creates a new set of bureaucratic restraints on the states."

But Downey warned that without the new program, welfare parents and their children were in danger of becoming a permanent underclass.

To fight that, Downey emphasized that when welfare parents work their way off the rolls, they would receive day care aid for up to a year to ease the transition to permanent employment. The bill also strengthens collection of child-support payments from an absent parent, requiring mandatory automatic withholding from the paycheck of the absent parent each payday, even if not in arrears.

In separate legislation, also designed to ease the transition to employment, Medicaid benefits could be provided for up to 24 months after a person leaves the welfare system for work.

During the debate, Republicans, charging that the cost of the Democratic bill was too high, sought to substitute their $1.1 billion five-year proposal. Backers of the substitute sponsored by Minority Leader Robert H. Michel (R-Ill.) said it would remove more people from welfare rolls.

But Democrats killed the substitute 251 to 173, calling it inadequate. Michel warned that the Democratic bill would be vetoed.

Brown, principal author of the GOP substitute, charged that the Democratic bill, although intended to promote work, actually "discourages work in at least eight ways."

One way, he said, is by exempting mothers with children under three, those persons generally considered most desirable to train before they become totally dependent on welfare. Brown also cited provisions allowing welfare clients to turn down jobs that do not pay at least as much as their benefits or that did not pay at least the going wage in the prospective employer's firm.

In addition, he said, the bill includes three major benefit increases that would make it easier for people to live on welfare and therefore discourage them from working.

One requires all states to provide welfare coverage to two-parent families where the father is present but unemployed, which would increase AFDC coverage by about 90,000 families or 350,000 people.

A second change would permit welfare beneficiaries who have some earnings from a job to keep the first $100 a month of such earnings and 25 percent of the remainder without reduction of benefits.

The third would encourage states to increase their benefits by raising the federal share of welfare costs by 25 percent for any state benefit increase taking place between Oct. 1, 1988, and Oct. 1, 1991.

Democrats said the three changes, while improving benefits, would not discourage people from seeking work because most people prefer work to welfare.

In defending the provision to induce states to increase benefits, Democrats said AFDC benefits are below the poverty line in every state. Maximum benefits for a family of three in the average state are 50 percent below the poverty line, which was $8,738 in 1986.

Before final passage, the House adopted 336 to 87 an amendment by Rep. Michael A. Andrews (D-Tex.) cutting the bill by $500 million, to $5 billion. The amendment was authorized by Democratic leaders in an effort to hold the support of Democratic moderates and fiscal conservatives who disliked the bill's price tag.

Yesterday, 13 Republicans voted with the Democrats on final passage, while 31 Democrats voted against. Members crossing party lines in the metropolitan area were Rep. Constance A. Morella (R-Md.), who voted for the bill, and Rep. Beverly B. Byron (D-Md.), who voted against it.

The Senate bill is sponsored by Sen. Daniel Patrick Moynihan (D-N.Y.) and costs $2.3 billion over five years. It is awaiting Finance Committee action next year, with more than half the Senate as cosponsors.