I'd suggest Cusco. I've only been to Peru as a tourist, but Lima is not very nice. I'd recommend buying a Rough Guide to help you decide - it will be money well spent.
Depending on the time of year you go, there are sea mists in Lima. We stayed at the Lighthouse (Faros ?? in Spanish) hotel and you couldn't even see the lighthouse for the fog. A fifteen minute walk later we could see it (and the light was working), but couldn't see down to the beach. We returned to the hotel as the pollution was so bad we couldn't breathe. Of course, not every day was foggy, but it's a big city and not always easy to get around safely without taxis.
The beach and sea can be cold - I think it's the same cold current that comes from Antarctica, which brings penguins to the Galapagos Islands (which are pretty much on the equator).
Cusco is safer and prettier than Lima. There are plenty of young people doing a gap year world tour, and passing through, so there are plenty of people to talk to. You absolutely must go to Machu Picchu. There are "backpacker" carriages on the train (these are not cheap and grotty), which reduces the cost. There are loads of agencies which can arrange the trip for you, or simply chat to others of your age and go along with them. Do try to go one day, overnight in Aguas Calientes, then get in the bus queue at 05:30 for the first buses up to the site the next day, for maximum time there, before leaving for the afternoon train back to Cusco.