Can I take leftover antibiotic for kidney infection?

No. Not a good idea. No. Need a full course of antibiotics to treat an infection, and "leftovers" might not provide you with enough medicine to treat the infection. Also, not all antibiotics treat urinary infections. A "leftover" antibiotic from a previous skin infection, for example, might not work for your present urinary tract infection.
Not wise. Using both the correct type and correct amount of antibiotic is important. If you have some leftover pills, it is not likely either of these criteria are fulfilled by using your leftover medications. Improper use of antibiotics is a major cause for antibiotic resistance. Allow your doctor to check you and prescribe the proper treatment.