A metric space is totally bounded if and only if its completion is compact. A subset of a complete metric space is totally bounded if and only if its closure is compact. A metric space $X$ has the property that its bounded subsets are totally bounded if and only if the completion of $X$ has the property that its closed and bounded subsets are compact, a property sometimes called the Heine-Borel property.
Montel spaces are examples of these.
Here's an open access article by Williamson and Janos you may find interesting. For example, Theorem 1 (which they credit to a 1937 paper of Vaughan) says that a metrizable, $\sigma$-compact, locally compact topological space has a compatible metric with the Heine-Borel property.