From 2 months in advance, to a few hous before. You can Book from every station in most of Europe and from any travel agent in the same area. From other areas you must book at least 6 days before and you are subject to a sometimes hefty surcharge. You can reserve any place in EC and IC and night trains. On expresses and IR trains you can reseve sometimes only 1st OR 2nd class or only for some stations.
Groups can reserve places on all but commuter trains.
Trains make up only whit salon carriages that do not allow peoples without a place require reservation. If you do not reserve you can still board if there is room, but you will have to pay an additonal 10000L fare. On medium distance and ICs Mon and Sat morning and Fri and Sun Afternoon, In some areas you will found a peak of crowd also on sun morning. Consider that is some staions on Friday and Sun afternoon is virtually impossible buy tickets.