Peak holiday times are National Day Holiday (October 1 to 7) and Spring Festival (February). Try to avoid travel at these times, it can get very busy, but if you do it is still worth the experience; you will be sharing your holiday with a great multitude of Chinese travelers.
You can buy train tickets a few days in advance of travel only. If you are a guest in a quality hotel (or have a friend there) the management can arrange tickets for you at short notice.