Trenitalia's train schedules and fares are typically only released between 90-120 days in advance*, so it's not a good idea to solidify travel plans before that point—the timetable can change seasonally.
You can buy your train tickets roughly 2 months ahead of when you'll need them, and can even book them the day before your train trip. Once you're in Italy, you can buy tickets just before you get on a train.
Buying tickets soon after they're released gives you a better chance of securing seats during busy travel days, and may give you access to sales or ticket discounts that are only available for advance purchases.
* The 90-120 day figure refers to high-speed trains. Regional train tickets are usually only available about 60 days in advance.