You need to have 4 billion Lego studs at once. Given that:
Silver stud: 10
Gold stud: 100
Blue stud: 1,000
Purple stud: 10,000
This will be painful to do without the x2, x4, x6, x8. and x10 multipliers on, *all at once*, for a total multiplier of x3840. If you want to do this the "right" way, you can unlock these multipliers by finding the red Lego brick in each of the five levels of the first Villain episode, and then purchasing each of the multipliers as Extras. All told, the five multipliers will cost 15 million studs.
Alternatively, you can use the "Enter Code" feature of the game to unlock the multipliers early:
Just make sure to turn on all of the multipliers in the Extras menu. After doing so, you should see a magenta-colored x3840 in the upper-left part of the screen. Extras reset every time that you load your game, so make sure to repeat this step after loading.
Other than that, just play through anywhere from about 7-20 complete levels with the x3840 multiplier in effect. (I got about 600 million studs going through Hero level 1-5 in Free Play.) Make sure to destroy as many objects and complete as many build-its as you can. Free Play works best, because you'll be able to switch characters and suits on demand to access more areas and therefore more studs.
Places to find lots of studs:
1. Multipliers count while in the Batcave and Arkham, too. With the x3840 multiplier in effect, a character with double jump (Clayface, Poison Ivy, Harley Quinn) can earn almost 100 million studs in the Arkham mission room. The Batcave and Arkham studs regenerate after reloading the game and when returning to the Batcave/Arkham from playing a level.
2. Machines for the Attract Suit sometimes cough up a lot of blue studs if you feed them a *second* set of 25 pieces. Usually, it is possible to gather that many pieces only in Free Play.
3. Completing a minikit by finding all 10 pieces of memorabilia in a level will earn you a lot of blue studs.