For the trip to Bergamo, it doesn't matter. That will be a regional train with no assigned seats. The fare will be 6.10 euros each way no matter when you buy the ticket.
For Turin you will want to take one of the Freccia trains, and those are assigned-seat trains with variable fares. You can potentially save a significant amount of money by making that purchase early. To get an idea of how much you might save, price out the trip as if you are traveling tomorrow and as if you are traveling in early May.
https://www.trenitalia.com/en.html
I believe the second major rail company in Italy, Italo, serves the Milan-Turin route, so you can also check fares there. Italo doesn't go to Bergamo.
https://www.italotreno.com/en
I think sellouts are quite unusual on Italian trains, but since you're traveling during a holiday weekend, I think it would be prudent not to wait until the day of travel to get the Turin tickets, even if you aren't concerned about their potentially escalating cost. The Bergamo trains can't sell out.