Energy customers will automatically receive compensation from today if they suffer switching errors or if suppliers are late in refunding credit when they leave.
Ofgem said the new requirements will give customers peace of mind that they will be compensated if anything goes wrong during the switching process.
The regulator also warned suppliers that compensation should act as a "wake-up call" for them to cut the number of problems and boost confidence in switching.
Ofgem will separately introduce new requirements for suppliers to pay automatic compensation for delayed switches and providing late final bills later this year.
For switches starting from May 1, customers will automatically receive compensation for so-called "erroneous switches", where they are mistakenly switched to another supplier.
Under the new rules, customers will be entitled to compensation up to a maximum of £120 if their supply is not restored to the correct supplier in a timely fashion. Both the gaining and losing suppliers are subject to the new rules.
Customers will also be entitled to a £30 payment if their previous supplier is late in refunding them their credit balance after they have switched.
Under Ofgem rules, suppliers must refund these credit balances within 10 working days of a final bill being issued.
Suppliers are required to pay compensation automatically to the affected customer within 10 days of the breach occurring. They will have to make a further payment of £30 if they fail to make the initial payment.
Ofgem said problems are increasing - although the vast majority of switches occurred without a hitch - as consumers turned to new suppliers to get a better deal.
Rob Salter-Church, director of retail systems transformation at Ofgem, said: "When a switch goes wrong, it can cause inconvenience, and, in some cases, real worry and stress for those affected.
"Automatic compensation payments from May 1, and additional payments this year, should serve as an incentive for suppliers to raise their game and get switches right first time."
The Energy Ombudsman, which recently revealed that switching is now second only to billing as a source of unresolved energy complaints, welcomed the move, but added that suppliers should not simply award compensation without trying to fix the root cause of the problem.
Energy Ombudsman chief executive Matthew Vickers said: "Suppliers shouldn't treat automatic compensation as a business cost without addressing the underlying issues."
Which? head of home products and services Natalie Hitchins said: "Switching is the ultimate way for consumers to avoid rip-off energy tariffs, yet the regulator has estimated energy customers would have been owed more than £70 million in just one year for switches gone wrong had automatic compensation been in place, and with switching on the rise this figure could be even higher.
"The regulator now needs to enforce its automatic compensation standards so that energy companies get it right first time and consumers are not put off switching - given they could potentially save more than £300 a year."
Martin Lewis, founder of MoneySavingExpert.com, said: "The new rules are progress, but there is still a big hole. While telling firms they must give credit within 10 days of the final bill, Ofgem hasn't told them how quickly the final bill must be sent, and we know in some cases it can be a year after customers have left.
"This is farcical, and Ofgem must urgently address this, or providers have a very easy loophole to continue delaying paying people money back, and depriving people of their hard-earned cash."
An Energy UK spokeswoman said: "While only a relatively small number of switches go wrong, that's still too many if you are the customers involved, so we support any moves that will give more customers the confidence to benefit from a very competitive marketplace with around 60 suppliers to choose from."