Warsaw has more to do but is much less compact and more spread out (look on Tripadvisor under Things to Do for both cities). In Warsaw, stay along the Royal Way (Krakowskie Przedmieście) or close to the Old Town or even city center (subway or tram can get you around fast and cheaply, and the main train station is in the city center). On the weekends especially, even 4-star business hotels downtown are very inexpensive (Radisson Blue, Hilton, etc). Look at www.booking.com to locate the hotels and filter by price and other amenities. There are also lots of charming mom and pop and boutique hotels that won't break the bank. I don't have recommendations since I stay with family.
Krakow is so compact that any place you stay within walking distance of the old quarter should be fine. Also consider the Kazimierz district, which is the old Jewish district in Krakow...lots of good restaurants nearby. Everything is walking distance so very easy to get around.
Since 5 days is very short, I would say give Warsaw 2 full days (or 1.5 days at a minimum) and spend the remaining 3 in Krakow. Allow a day for a side trip to Auschwitz and/or the Wieliczka Salt Mine.