This paper discusses the influence of time horizon on dynamic optimization of small-size wastewater treatment plants alternating aerobic and anoxic processes. The optimization problem consists in determining the aeration policy (air-on and air-off periods) that minimizes the energy dissipated by the aeration system subject to both effluent and operating constraints. Optimization over short time horizons is first considered and reductions of the energy consumption up to 30% are obtained with respect to the usual operating mode of the process. But the application of such aeration strategies eventually results in a biomass wash-out when applied over long time periods. Here, it is shown that long time horizon optimized policies guarantee a durable functioning of the treatment plant. The resulting energy consumption savings are however lower (up to 15%), but are still important.