Time-varying network topologies can deeply influence dynamical processes mediated by them. Memory effects in the pattern of interactions among individuals are also known to affect how diffusive and spreading phenomena take place. In this paper we analyze the combined effect of these two ingredients on epidemic dynamics on networks. We study the susceptible-infected-susceptible (SIS) and the susceptible-infected-removed (SIR) models on the recently introduced activity-driven networks with memory. By means of an activity-based mean-field approach we derive, in the long time limit, analytical predictions for the epidemic threshold as a function of the parameters describing the distribution of activities and the strength of the memory effects. Our results show that memory reduces the threshold, which is the same for SIS and SIR dynamics, therefore favouring epidemic spreading. The theoretical approach perfectly agrees with numerical simulations in the long time asymptotic regime. Strong aging effects are present in the preasymptotic regime and the epidemic threshold is deeply affected by the starting time of the epidemics. We discuss in detail the origin of the model-dependent preasymptotic corrections, whose understanding could potentially allow for epidemic control on correlated temporal networks.