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).