I'm going on a trip, and different ages have different prices.
Should I use the age when I leave for the trip or come back from the trip?
The price is for plane flights.
In general the age you are when you fly is what counts AND that is both directions.
As an example, if you are looking at a youth rate, the airline will look at your age on both legs and the fare will be based on the higher rate. ie if you fly out under a youth rate, but have a birthday and return as an "adult", then the entire airfare will be based on adult rates.
Same for infant fares, if your child turns 2 while traveling, the entire ticket will be at 2 year old fare, not infant fares.
While you could conceivably buy two one ways, one at each rate, the cost of one ways are considerably more than discounted round trips, so not really advantageous.
I suspect that your age on the date of departure is the significant factor. If your birthday is in the middle of the trip, it might be possible to purchase a ticket where the outbound leg is booked under your current age and the return leg is booked under your new age. If that is not possible then the entire ticket will probably booked based on your age at the start of the trip.