Only 400 people are allowed to enter Huayna Picchu each day. The government website (http://www.machupicchu.gob.pe/) lists how many tickets are available for each day. In the low season it should not be a problem and you should be able to buy your ticket at the last minute. During high season it fills up quickly and you might need to buy your ticket in advance.
The number of visitors climbing each of the mountains is restricted to 200 a day. Huayna Picchu is not as high and easier and therefore more popular. Tickets for it might sell out more than a week in advance in high season. Montaña Machu Picchu is higher and difficult, but the views are actually better. Tickets for it sometimes sell out. You can check the availability for any, at any time on the website.
The first 200 entrance : 8:00 - 09:00
The Second 200 entrance: 10:00 - 11:00
There are different type of Machu Picchu
Machu Picchu (Mapi) : S/ 152 Soles
Machu Picchu + Huayna Picchu: S/200 Soles
Machu Picchu + Montaña: S/ 200
Machu Picchu (Mapi) : S/ 77 Soles
Machu Picchu + Huayna Picchu: S/ 125 Soles
Machu Picchu + Montaña: S/ 125
On the Inca Trail only included the entrance fee to Machu Picchu and Inca Trail, if you would like to climb up to the Huayna Picchu Mountain, you have to buy the extra ticket the Machu Picchu + Huayna Picchu. it is new retriction for the Peruvian law.
It is similar the regulations for the Inca Trail and Huayna Picchu, it is not included, we recommend to buy a new ticket for this mountain. the price is cheap minus 10 dollars