The Piggy Bank grows by one Golden Egg every time something gets upgraded or purchased. You can 'crack' it for the aforementioned price, which will reset the counter to 0 and give you all the Golden Eggs inside the Piggy Bank. To crack open the Piggy Bank you need to purchase this in-game with the price of $2.99 or £2.99.
In order to fill it up quickly, you should prestige often. Make sure to not skip housing or vehicular upgrades; get them all. If you're really extreme, don't skip eggs after late-game prestiges. When to crack it is your choice, but 15-25 thousand is a good rule of thumb, followed by 35-50 thousand on the 2nd crack. You need 674,523 Golden Eggs to get all Epic Research, but saving that much would require constant prestiging.