No, not necessarily. If $C(X)$ embeds into $B(H)$ then $X$ must be ccc, but there exist compact Hausdorff spaces of cardinality $\mathfrak{c}$ which are not ccc. (One example is to take $\mathfrak{c}$ with its discrete topology and form the one-point compactification $\mathfrak{c} \cup \{\infty\}$; then all the singletons except $\infty$ are disjoint open sets. Another is the ordinal $\mathfrak{c}+1$ with its order topology; all the successor singletons $\{\alpha+1\}$, $\alpha < \mathfrak{c}$, are disjoint open sets.)
To see this, suppose that $X$ is not ccc, so that there is an uncountable family $\{U_\alpha\}$ of disjoint nonempty open sets. By the appropriate version of Urysohn's lemma, for each $\alpha$ there is a nonzero real-valued $f_\alpha \in C(X)$ supported inside $U_\alpha$; in particular, $f_\alpha f_\beta = 0$ for $\alpha \ne \beta$. Now if there is an injective *-homomorphism $\Phi : C(X) \to B(H)$, then each $\Phi(f_\alpha)$ is nonzero, so we may find $h_\alpha \in H$ so that $\|\Phi(f_\alpha) h_\alpha\|=1$. Also, $\Phi(f_\alpha)$ is self-adjoint, so for $\alpha \ne \beta$ we have
$$\langle \Phi(f_\alpha) h_\alpha, \Phi(f_\beta) h_\beta\rangle = \langle h_\alpha, \Phi(f_\alpha)\Phi(f_\beta) h_\beta\rangle = \langle h_\alpha, \Phi(f_\alpha f_\beta) h_\beta\rangle = 0$$
so that $\{\Phi(f_\alpha) h_\alpha\} \subset H$ is an uncountable orthonormal set, which is impossible if $H$ is separable.
This is fairly close to optimal because every separable compact Hausdorff $X$ does have $C(X)$ embeddable into $B(H)$ (recall that separable implies ccc but not conversely). Indeed, if $\{x_n\}$ is a countable dense subset of $X$, then identifying $f \in C(X)$ with the sequence $(f(x_1), f(x_2), \dots)$ gives an isometric embedding of $C(X)$ into $\ell^\infty$, which as we know embeds in $B(\ell^2)$. Presumably there is a necessary and sufficient condition somewhere in between, but I don't know what it is.