Let $(X,d)$ be a metric space such that $d$ is not the discrete metric. Let $x_0 \in X$, let $r>0$, and let $$B(x_0;r) \colon= \{ x \in X \colon d(x,x_0) < r \}$$ be the open ball with center $x_0$ and radius $r$, and let $$\tilde{B}(x_0;r) \colon= \{ x \in X \colon d(x,x_0) \leq r \}$$ be the corresponding closed ball.
Then what is (are) the necessary and sufficient condition(s) on $X$ and / or $d$ such that the closure $\overline{B(x_0;r)}$ of $B(x_0;r)$ is different from $\tilde{B}(x_0;r)$?