For Flights - between 40 to 30 days before the date of travel. Most of the airlines give max rebate rates around 30 days in advance.
For Hotels - About 5-7 days in advance you get the best rates. Thanks to the very many hotels available onlinevin almost all cities n towns, there is no need to book much in advance. And, we usually avoid paying any amount in advance - because unlike airlines - individual hotel guys trouble you a lot for giving refunds. Avoidable headache.