If you book only transportation we recommend doing it 2 weeks in advance, but if you buy the full tour it is recommended to do it 2 to 3 months before in order to get your admission to machu picchu on the first shift.