How long after landing on Mars should astronauts spend on it before they can go back, if both flights are in semi-elliptical orbits?

About 1.3 years. It is taken into account that during the flight both the Earth and Mars move, and at the moments of landing the planet should be in the aphelion of the ship’s orbit when the ship comes into it. In practice, for landings, the orbit (speed) of the spacecraft has to be corrected at least due to its change under the influence of disturbances in its motion caused by the attraction of this planet and other bodies.

Remember: The process of learning a person lasts a lifetime. The value of the same knowledge for different people may be different, it is determined by their individual characteristics and needs. Therefore, knowledge is always needed at any age and position.