Babies and juveniles are best kept in smaller enclosures. Usually a medium to large critter keeper will do nicely. Pacman Frogs do not need a lot of space because they spend the majority of their lives burrowed in favorite spots that yhey choose in their enclosure and don't use much of a large enclosure when provided.
A 5 to 5.5 gallon is just fine and a adult male can live happily for his entire life in such and enclosure. Females usually need larger enclosures once they reach adulthood due to them being larger, but they still only use a few select spots in their homes. They can even be kept in a 12"x12"x18" and be as happy as can be. It's all about keeping stress low and giving them what they need. Large enclosures are not a need, but more of a decoration to display your animal in a pretty setup, but is unnecessary.
I keep my males in either a medium to large critter keeper or a 12"x12"x18" enclosure. You may be wondering why I'm using a tank made for arboreal species of frog when a Pacman is terrestrial and the reason is lighting. A taller tank allows me to keep ample distance from surface of the substrate and the light. This allows the ambient air in the enclosure to be warmed and the distance protects the frog. Of course when using any kind of lighting I suggest providing plant cover whether it be live or fake. Large broad leaves provide shade and a place where they can hide so they are not sitting directly under the heat light. Lights are optional though and should only be used if you are having difficulty maintaining the tropical climate they need. Or if you need a way to create a 12 hour day/night cycle.
Females n spend their froglet and juvinile stages in small, medium, and large critter keepers until they become large enough to need more room. A 10 gallon will do very well and is plenty of space even for a very large female. Again remember that they usually will not use much groundspace even if provided so it can become more of a hassel when cleaning the large tank than a smaller one. The largest you ever want to think about going with a Pacman is a 20 gallon and this can even seem like a waste since they won't use all the area, but you can fill in the extra space with plants and decor if you like.
Also keep in mind that the larger the enclosure the harder it is to maintain a consistant climate.
I hope this helps.