When is the centralizer of a subgroup equal to the center? Let $G$ be a group, and $H\leq G$ be a subgroup.  When is $C_G (H)=Z(G)$?
Similar to this question, which is about the centralizer of an element rather than of a subgroup: When is the centralizer and the center are equal
 A: I do not think there is a general condition. What you can say is this.
(a) $Z(G)=C_G(H)$ if and only if $Z(H)=H \cap Z(G)$.
(b) Note that $Z(G)=\bigcap_{g \in G}C_G(g)$. And $g \notin Z(G)$ if and only if $Z(G) \subsetneq C_G(g) \subsetneq G$. Otherwise put, if $C_G(g)=Z(G)$, then, since $g \in C_G(g)$, we get $g \in Z(G)$, whence $C_G(g)=G$, so $G=Z(G)$, which means $G$ is abelian. And if $G$ is abelian, then of course $C_G(g)=G=Z(G)$.
A: Here is another criterion, if you know Character Theory of Finite Groups. If not, consult the book, bearing the same title of Marty Isaacs, see for example here.

Proposition Let $H$ be a subgroup of the finite group $G$ $\chi \in Irr(G)$ and irreducible complex character and assume that the restriction $\chi_H \in Irr(H)$. Then $C_G(H) \subseteq Z(\chi)$.
Corollary If $H \leq G$, $\chi \in Irr(G)$ a faithful irreducible character, such that $\chi_H \in Irr(H)$ then $Z(G)=C_G(H)$.

So let us prove this. Let $\mathfrak{X}$ be an $\mathbb{C}$-representation that affords $\chi$. Let $x \in C_G(H)$. Since the restriction to $H$ is irreducible and $\mathfrak{X}(x)$ commutes with every $\mathfrak{X}(h), h \in H$, and it follows from Lemma (2.25) of the book (which is basically Schur's Lemma) that $\mathfrak{X}(x)=\varepsilon I$ for some root of unity $\varepsilon \in \mathbb{C}$. By taking traces it follows that $|\chi(x)|=\chi(1)$, that is $x \in Z(\chi)$.
Now assume that $\chi$ is faithful (meaning $ker(\chi)=1$). Since in general, $Z(G/ker(\chi))=Z(\chi)/ker(\chi)$, we obtain $Z(\chi)=Z(G)$. The proposition then yields $C_G(H) \subseteq Z(G)$. But of course the other containment, $Z(G) \subseteq C_G(H)$ is always true. Hence $Z(G)=C_G(H)$ as wanted. (Note that $Z(G)$ must be cyclic in this case since $Z(\chi)/ker(\chi)$ is always cyclic).
