On the maximum energy of particles accelerated in astrophysical jets