We will be taking the train from Saint Lazare station to Caen. How soon can those tickets be purchased online?
Normally up to about 4 months in advance. However, for that train route, you do not need to book that early. Booking a month or so in advance will already give you the best prices (around 15€).
You might find some older advice saying that trains to Normandy are regional trains that do not require reservations: this is outdated, reservations are now required, and walk-up fares are almost 3x the price of the cheapest advance tickets.
Balso - thank you. Is that timeframe the same if I wanted to purchase train tickets from Nice to Florence?