Cuzco is more touristic and safer, especially at night, than Lima. You have of course nice areas with nightlife in Lima, but I'd stay one more night in Cuzco, if I had to decide. Daytripping into Lima is possible from the airport, however be aware that traffic is sometimes hard to predict and as such the time you need to go downtown and come back to the airport. But 7-8 hours are sufficient to get an impression from the colonial center, but you won't have time to see much more.