An Exact Characterization of the Generalization Error for the Gibbs Algorithm