A physical fence is usually a better option than an electronic one. A physical fence will also help keep people and other animals out of your yard. An electronic fence doesn't keep people or other animals out, and there are other issues, as well. Some dogs find them so traumatizing that they become fearful of going outside. Other dogs will blow right though them if they are chasing something, bu them won't come back into the yard after they have calmed down because that's hen they feel the zap. Other dogs learn that getting just close enough to the barrier to activate the warning beep will eventually wear the battery down, and they can wander at will.
To answer your question directly the various underground barrier fence installers say you can start as young as 8 weeks old. I think that is too young.
I use an e collar in obedience training and prefer to wait until a year old but that is a different application. Hunting dog trainers start younger than this, but again, that is a different application.
I prefer a physical fence to an electronic one for some of the reasons stated above, but your question was not about my preferences.
Here's my take on it. No dog should be let loose with an electronic fence until you KNOW that dog will be secure with it.
As @LeoRose mentions, some dogs will go right through it without any hesitation. That makes the fence completely useless for your purpose.
It's not just about age, but about breed, training, individual personality, etc.
First, what breed(s) are your dogs. Are they scent hounds or sighthounds? Are they huskies or other high-level escape artists? Or are they more people-pleasing dogs like shepherds or goldens? Or are they tenacious like terriers?
Second, how obedience trained are they? Do they have strong recall? Are they fast learners? And with that, do they self learn (ie, do they teach themselves behaviors for entertainment or do they mostly learn only what you actively teach them)?
Third, do they have any individual traits or issues that could affect the fence's effectiveness. Things like fear of fireworks, dogs, people, etc. A scared dog will go through an electric fence without hesitation.
My last thoughts again agree with @LeoRose. An electronic fence does nothing to keep other things out of your yard. Wildlife, people, stray dogs, etc, will all be able to enter and exit freely. If your dog is outside and a stray dog comes along, your dog may not be able to escape if that dog becomes aggressive. Same as with tie outs. The best most secure yard is a fenced yard.