In general (for any topological space $X$ at all), $\mathbf{X}$ is the Stone-Cech compactification of $X$. That is, there is a canonical continuous map $i:X\to\mathbf{X}$ such that for every compact Hausdorff space $K$ and every continuous map $f:X\to K$, there is a unique continuous map $g:\mathbf{X}\to K$ such that $gi=f$. (Explicitly, $\mathbf{X}$ is the space of $*$-homomorphisms $C(X)\to\mathbb{C}$, and $i:X\to\mathbf{X}$ takes any $x\in X$ to the homomorphism given by evaluation at $x$.)
Now, the Stone-Cech compactification is not always a compactification in your sense. Specifically, it is a compactification (embedding with dense open image) iff $X$ is locally compact and Hausdorff. This condition is obviously necessary, since any open subspace of a compact Hausdorff space is locally compact Hausdorff. Conversely, the image of $i$ is always dense, and $i$ is an embedding iff $X$ is completely regular. In particular, if $X$ is locally compact Hausdorff then $i$ is a embedding with dense image and its image is therefore open since any dense locally compact subspace of a compact Hausdorff space is open.
As for what you call $C_b(X)$, it is just $C(X_d)$ where $X_d$ is $X$ with the discrete topology. So, the $\mathbf{X}$ you obtain from this is just the Stone-Cech compactification of $X_d$. This will never be a compactification of $X$ in a canonical way unless $X$ is discrete so that $X=X_d$ (in particular, the canonical map $i:X\to\mathbf{X}$ is not continuous with respect to any topology on $X$ besides the discrete topology, since it is an embedding with respect to the discrete topology).
(Incidentally, what you call $C(X)$ is what is more commonly called $C_b(X)$. Typically $C(X)$ refers to the algebra of all (not necessarily bounded) continuous functions on $X$.)
For the commutative case, your claim is true: $\widehat{C_0(X)}$ is homeomorphic to $X$ and $C_0(X)$ is unital iff $X$ is compact.
For the non-commutative case, there are counter-examples.
Take any non-unital, simple $C^*$-algebra with dimension at least 2, for example the compact operators over an infinite dimensional Hilbert space $K(H)$. If $\phi:K(H)\to\mathbb{C}$ is a *-homomorphism, then $\ker(\phi)$ is a closed, two sided ideal. Since $K(H)$ is simple, $\phi=0$ or $\ker(\phi)=0$. If $\ker(\phi)=0$, then $\phi$ is injective and thus $K(H)$ is one dimensional, which is false. So there exist no non-zero *-homomorphisms $K(H)\to\mathbb{C}$, i.e. $\widehat{K(H)}=\emptyset$.
Do you consider the empty set as a non-compact space? No problem, here is another one:
consider $A=K(H)\oplus \mathbb{C}$ (coordinate wise operations and supremum norm on coordinates). This is a non-unital $C^*$-algebra and we have natural inlcusions (i.e. injective $*$-homomorphisms) $K(H)\subset K(H)\oplus \mathbb{C}$ and $\mathbb{C}\subset K(H)\oplus\mathbb{C}$. Now if a non-zero $*$-homomorphism $\phi:K(H)\oplus\mathbb{C}\to\mathbb{C}$ exists, then $\phi\vert_{K(H)}=0$, by the preceding paragraph. Also, $\phi\vert_{\mathbb{C}}$ is a $*$-homomorphism on $\mathbb{C}$ so $\phi\vert_\mathbb{C}=0$ or $\phi\vert_{\mathbb{C}}=\text{id}$, and since we want $\phi$ to be non-zero, we must have $\phi\vert_{\mathbb{C}}=\text{id}$. In other words, there exists a unique non-zero $*$-homomorphism $K(H)\oplus\mathbb{C}\to\mathbb{C}$, namely $(x,\lambda)\mapsto\lambda$ and thus $\widehat{A}$ is a singleton. Whatever topology you put on a singleton, it has to be compact and not just locally compact. You can also take more copies of $\mathbb{C}$ in your direct sum and make non-unital $C^*$-algebras with maximal ideal space being finite sets (thus compact) and have larger cardinality.
To conclude: you claim that a $C^*$-algebra is unital if and only if its maximal ideal space is compact. For the commutative case this is true, for the non-commutative case this is false.
Best Answer
Let us write $F:X\to \Omega(C_0(X))$ for the map $F(x)=\hat{x}$. Let $U\subseteq X$ be open and $x\in U$. Let $V$ be open such that $x\in V\subseteq \overline{V}\subseteq U$ and $\overline{V}$ is compact. By Urysohn's lemma, there exists a continuous function $f:X\to [0,1]$ such that $f(x)=1$ and $f(y)=0$ for all $y\in X\setminus V$. Since $\overline{V}$ is compact, $f\in C_0(X)$. We now see that $\{\hat{y}\in\Omega(C_0(X)):\hat{y}(f)\neq 0\}$ is an open subset of $\Omega(C_0(X))$ which contains $\hat{x}$ and is contained in $F(U)$. Since $x\in U$ was arbitrary, this means $F(U)$ is open, and so $F$ is an open map.