If $M$ is of dimension $<4$, then the answer is YES as there is no exotic structures on $M$ and classification results are well studied.
It is not true in dim 4. For example,
Any closed simply-connected 4-manifold $M$ and its exotic copy $M'$ are h-cobordant by a theorem of Wall. Thus $M\times S^1$ is h-cobordant to $M'\times S^1$ (as one can extend the previus h-cobordsim trivially on the $S^1$ component). Which is trivial by high dimensional s-cobordism theorem which says that such a cobordism is trivial if Whitehead torsion of $\pi_1(M\times S^1)$ vanish (https://en.wikipedia.org/wiki/H-cobordism#The_s-cobordism_theorem) and $Wh(\pi_1(M\times S^1))= Wh(\mathbb Z)=0$ by a result of Bass (http://www.numdam.org/item/?id=PMIHES_1964__22__61_0). So they are in fact diffeomorphic.
When dimension $M> 4$ and $M$ is simply connected then the answer is YES. And this is follows from the high dimensional h-cobordism/s-cobordism theorem. As our previous discussion says that if $M\times S^1$ is diffeomoric to $M'\times S^1$ then they are h-cobordant and which is trivial. This implies $M$ and $M'$ are h-cobordant and thus $M$ is diffeomorhic to $M'$.