I’ve had foals raised and bred at the barn I am at. Foals do most of their growing in the last trimester, therefore riding them during that time would be crucial. They are okay to ride for the first several months but very important to slowdown and stop after that. Usually about 3 months before giving birth, sometimes even more.
Hope this helped! :)
Probably up until there is about a month to go. If it’s really hot and it it seems to be too much, maybe stop earlier. Ik you can ride up until a few days before but I would probably stop earlier.