Bohr compactification as a topological compactification
The answer is no: unless $G$ is compact, its subspace topology inside $bG$ (called its Bohr topology) is much weaker than its own. So $\iota:G\to bG$, while continuous with dense image, is not an embedding (homeomorphism onto $\iota(G)$), hence not a compactification in the sense of topologists.
Rudin (1962, pp. 30-31) notes this without proof. Later Katznelson (1973) gave a method to show that very “thin” subsets of $G$ are dense in the Bohr topology: e.g. $\mathbf N$ inside $\mathbf Z$, a parabola inside $\smash{\mathbf R^2}$, etc. For more details and references see (with apologies for the plug) this paper, esp. Lemma 1(4).
Note: I have restricted my answer to abelian $G$; $\iota$ can be defined for any topological group, but your question only makes sense when $\iota$ is injective, i.e. for “maximally almost-periodic” $G$, and these are very nearly the compact $\times$ abelian ones: see Dixmier (1977, §§16.1, 16.4).
As Francois Ziegler answered, for a locally compact group $G$, the Bohr compactification of $G$ is a compactification in the usual sense iff $G$ is compact. This is true with no further restrictions.
Recall that the forgetful functor from compact groups to topological groups has a left adjoint functor, denoted here $b$. For any topological group $G$, the identity in $\text{Hom}(bG,bG)$ corresponds to an element of $\text{Hom}(G,bG)$ called the unit, $u:G\to bG$. It is easy to check that $u(G)$ is dense in $bG$ (this is usually seen directly from the construction of $b$, but also follows from the abstract nonsense). The homomorphism $u:G\to bG$ is known as the Bohr compactification of $G$. This terminology is a bit unfortunate, as $u$ is not a compactification in the sense usually used in topology, unless $G$ was compact to begin with (in fact, $u$ is rarely injective - groups for which $u$ is injective are called "maximally almost periodic").
By a "compactification in the usual sense" of a locally compact space $X$ one means a continuous map $f:X\to Y$ where $f(X)$ is dense in $Y$ and $f:X\to f(X)$ is a homeomorphism. In that case $f(X)$ is necessarily open in $Y$ (this an easy exercise).
In case $X$ and $Y$ were groups and $f$ a group homomorphism, $f(X)$ was also closed, as any open subgroup is closed, thus $f(X)=Y$ by density. So $X$, being homeomorphic to $Y$, must have been compact to begin with.
More generally, let me note that any locally compact subgroup of any topological group is necessarily closed (and if the ambient group is locally compact, a subgroup is locally compact iff it is closed).