For this answer I shall assume all spaces are Tychonoff since when dealing with rings of continuous functions, it suffices to deal with Tychonoff spaces. The property that you need is realcompactness. A space is said to be realcompact if it can be embedded as a closed subspace of some product $\mathbb{R}^{I}$ for some set $I$. Like compactness, there is a notion of a realcompactification. If $X$ is a space, then a set of the form $f^{-1}[\{0\}]$ is called a zero set. The complement of a zero set is known as a cozero set. If $X$ is a completely regular space, then the Hewitt-realcompactification $\upsilon X$ of $X$ is the intersection of all cozero sets $U\subseteq\beta X$ with $X\subseteq U$. A completely regular space is realcompact if it is equal to its realcompactification. It is well known that if $X,Y$ are completely regular spaces, then $C(X)\simeq C(Y)$ if and only if $\upsilon X\simeq\upsilon Y$. In particular, if $X,Y$ are realcompact spaces and $C(X)\simeq C(Y)$, then $X\simeq Y$. A space of cardinality below the first measurable cardinal is realcompact if and only if it can be given a compatible complete uniformity. Realcompactness can also be characterized in terms of the Baire $\sigma$-algebras. If $X$ is a completely regular space, then the Baire $\sigma$-algebra on $X$ is the $\sigma$-algebra on $X$ generated by the zero sets. A completely regular space is realcompact if and only if every $\sigma$-complete ultrafilter on the Baire $\sigma$-algebra is principal.