Sometimes they are used interchangeably, but there are some differences.
As far as I know, both stutter and stammer exist and describe the same speech dysfluency is because stammer is a mostly British term, whereas stutter is largely used in the US, and New Zealand and Australia.
Some definitions describe a stutter as the repetition of letters, whereas a stammer is the blocking and prolongations but I don't think most people make that distinction.