RFBF: I did this combo in September 2016. Flew Boston to Lima, then Lima to Cusco on LATAM. After overnighting in Cusco to acclimate to the altitude, I took the PeruTrail train the following morning from Cusco to Aguas Calientes, which is the town at the foot of Machu Pichu. I arrived into Aguas Calientes late morning, checked in at my hotel, and then spent that afternoon doing the ruins to shoot them with the afternoon sun.
The following morning I went back to climb Machu Pichu Mountain and also to reshoot the ruins with the morning sun. I left that afternoon and headed back to Cusco on the same PeruTrail train. Overnighted in Cusco and then flew back to Lima on LATAM. I then flew from Lima to Guayaquil on TAME and after overnighting in Guayaquil, I flew to Baltra in the Galapagos. About TAME: to me, they were a joke. Big time delays on the LIma-Guayaquil flight as well as on the flight back from Galapagos to Guayaquil after my Galapagos dive trip. So I have nothing good to say about them (TAME).
There is a luggage storage facility at the Lima airport but they are not inexpensive. I found out because I had a long (8 hr) layover in Lima (that became 14 hrs thanks to TAME), after returning from Machu Pichu, before flying to Guayaquil. I couldn't check in that early before departure, so I thought about storing my luggage so that I could go into town and have dinner there before returning to the airport for my flight. But the cost was a lot more than what I wanted to pay. Had I chosen to spend an additional night in Lima before flying to Guayaquil, then storing it at the LIma hotel would have been the most likely option.
So as far as what to do with the luggage while in Machu Pichu, I took it with me to Cusco. Since I had to overnight there after Machu Pichu before flying back to Lima, I stored most of it at the hotel I stayed at in Cusco and just took a carry-on with me to Machu Pichu.
I have a rather lengthy write-up with more details and logistics information. I would be more than glad to email it to you if you wish. It's just too much to paste here. I will also add that I did everything the DIY way after doing some research on the internet, but I am sure that there is something to be said for having a tour operator do all the planning and bookings for you. Also, I chose to not tour the ruins with a guide because I was more interested in taking in the scenery while doing it at my own pace and getting my shots, as opposed to getting immersed in the culture, history and folklore, most of which I could probably read about in the internet.
The question of diving Galapagos land-based vs. liveaboard is an often debated topic. I've done Galapagos 5 times and to me, no dive trip to Galapagos is complete without going to the Northern Islands of Wolf and Darwin, and you can't do them land-based.