The truth is, there is no science to train availibilty!! Some trains such as those which travel on the Konkan Railway line, book up quiet fast when reservations begin, i.e. 60 days in advance. This means that trains can be booked weeks in advance, though it is seldom that all classes on a train will be booked from the day of reservation,even on the Konkan Railway ( west coast line) you can usually get some kind of berth with 4-5 day notice.
ALSO AROUND MAJOR FESTIVALS, THERE CAN BE LACK OF AVAILABLE BERTHS, SO BE AWARE!!
The higher the class of travel the quicker they book up. The reason for this is quite simple, there are far fewer berths in 1st AC 2, tier AC and 3 tier AC 1st AC will have around twelve berths only, 2 AC will have two coaches, 3 AC three coaches ( There is some variation in this but the numbers quoted are a good rule of thumb)
Compared to 10-12 coaches of ordinary second class sleeper coacher or more. So you can see how you chances increase as you go down the classes. Of course on some trains like the Rajdhani Express you will only have 1st AC, AC 2 tier AC 3 tier so the chances of scoring a AC berth are better though more expensive.
Generally speaking book as far up front as you can if you want to make certain places at certain times but if your happy to be not to be shackled by concrete itineraries, then just book as you go, usually you'll find a berth reservation two or three days upfront, for long distance trains (12 hours+) book as far up front as you can, these tend to book up faster
There are a few tricks you can employ to get that elusive seat/berth one has already been mentioned : The Tourist Quota. Some trains though not all have a few berths especially laid aside for foriegn tourists, these don't cost anything extra and can sometimes get you on a train that was to all intents and purposes "full"
At main stations there are special offices or ticket windows where you can buy these tickets, you will need your passport for this!!
For short journeys of 4-5 hours, I do this, buy an "general class" ticket, this class is not reservable and the ticket allows you onto get on the train allbeit in "cattle class" No need to stay there though (unless you like it of course) simply find an empty seat in second class (there are nearly alway empty seats awaiting passengers getting on at stations up the line) wait for the ticket inspector and ask him to upgrade you to second class or AC class if there's an empty seat, don't enter AC with your "general class" ticket its not allowed ask the ticket inspector and he will tell you if there are any vacant seats in AC.
On special trains like The Shatabdi/Rajdhani expresses this is not allowed!!
This is only good for short day journeys trying this on a night train when you need a berth is a BAD idea!!!!!!
Lastly there's the Taktal Quota, this quota is held back until three days before departure of the train!! This will sometimes get you on a "full" train as well but it's very expensive, as you have to pay for the whole route the train travels!! So say the Train is going from Mumbai to Trivandrum (kerala) and you want to go to Goa, you will be required to pay for the whole journey, not just to Goa. So an expensive way to travel but in a emergency........................
I've travelled for years "on the fly" and usually found some way to leave, within a few days, these days I book two or three tickes up front knowing I can always cash them in if I get stuck somewhere as I usually do (record 6 cancelled tickets from Ajmer to Udaipur

) Even upto 6 hours before departure you get some money back!
Just try to think ahead a little, that makes life all the easier!!
So no all your trains won't be booked out months ahead but booked trains may well throw you a curveball somewhere along the line!!
Ok so now I've totally confused you............right!!
Enjoy your holiday and don't stress, you always get to where you want to go in India it just takes a while sometimes!