Characterization of cutoff for reversible Markov chains