how much money do i have to have to level up in cash
What are your goals in poker?
If you're a recreational player and can fund your poker bankroll from another source (day job), then 20 buy ins are just fine. Playing $2/$5 a bank roll of $10,000 works.
If you're a serious regular player that is looking to really grow your bankroll and move up through the levels to the higher stakes, around 50-60 buy-in will cover most downswings and avoid you having to move down levels when the inevitable downswing hits. Playing $2/$5 a bank roll of $25,000+ should be enough.
If you want to play like a professional and avoid the risk of ever going broke, 100 buy-ins is the absolute minimum, and that is for the level you want to move up to, not where you're at at the moment, so if you're playing $2/$5, you should have a bank roll of at least $50,000 and you want to have $100,000 before moving up to $5/$10. You also need to be prepared to drop back down to $2/$5 if you lose a few buy-ins when you first move up.
I'm assuming you're playing NLHE. If you're playing PLO, you probably want to at least double all of the above because the swing in PLO are so much bigger.