The ability to orgasm and keep an erection is almost completely mental. If he's not in the right mental state, or does not find the stimulation to mentally be arrousing, or if he's not concentrating on the stimulation, he may not cum, or it may take him a long time to cum.