Let me rephrase the question (and Ilya's answer). Given an arbitrary collection $X_i$ of schemes, is the functor (on affine schemes, say)
$Y \mapsto \prod_i Hom(Y, X_i)$
representable by a scheme? If the $X_i$ are all affine, the answer is yes, as explained in the statement of the question. More generally, any filtered inverse system of schemes with essentially affine transition maps has an inverse limit in the category of schemes (this is in EGA IV.8). The topology in that case is the inverse limit topology, by the way.
It is easy to come up with examples of infinite products of non-separated schemes that are not representable by schemes. This is because any scheme has a locally closed diagonal. In other words, if $Y \rightrightarrows Z$ is a pair of maps of schemes then the locus in $Y$ where the two maps coincide is locally closed in $Y$.
Suppose $Z$ is the affine line with a doubled origin. Every distinguished open subset of an affine scheme $Y$ occurs as the locus where two maps $Y \rightrightarrows Z$ agree. Let $X = \prod_{i = 1}^\infty Z$. Every countable intersection of distinguished open subsets of $Y$ occurs as the locus where two maps $Y \rightarrow X$ agree. Not every countable intersection of open subsets is locally closed, however, so $X$ cannot be a scheme.
Since the diagonal of an infinite product of separated schemes is closed, a more interesting question is whether an infinite product of separated schemes can be representable by a scheme. Ilya's example demonstrates that the answer is no.
Let $Z = \mathbf{A}^2 - 0$. This represents the functor that sends $Spec A$ to the set of pairs $(x,y) \in A^2$ generating the unit ideal. The infinite product $X = \prod_{i = 1}^\infty Z$ represents the functor sending $A$ to the set of infinite collections of pairs $(x_i, y_i)$ generating the unit ideal. Let $B$ be the ring $\mathbf{Z}[x_i, y_i, a_i, b_i]_{i = 1}^\infty / (a_i x_i + b_i y_i = 1)$. There is an obvious map $Spec B \rightarrow X$. Any (nonempty) open subfunctor $U$ of $X$ determines an open subfunctor of $Spec B$, and this must contain a distinguished open subset defined by the invertibility of some $f \in B$. Since $f$ can involve at most finitely many of the variables, the open subset determined by $f$ must contain the pre-image of some open subset $U'$ in $\prod_{i \in I} Z$ wherefor some finite set $I$ is. Let $I'$ be the complement of some finite set in $\{1, 2, 3, \ldots\}$$I$. If we choose a closed point $t$ of $U'$ then $U$ contains the pre-image of $t$ as a closed subfunctor. Since the pre-image of $t$ is $\prod_{i \in I'} Z \cong X$ this shows that any open subfunctor of $X$ contains $X$ as a closed subfunctor.
SinceIn particular, if $\prod_{i \in I} Z$$X$ is closed ina scheme, any non-empty open affine contains a scheme isomorphic to $X$ as a closed subscheme. A closed subscheme of an affine scheme is affine, this implies thatso if $X$ is a scheme then it is affine.
Now we just have to show $X$ is not an affine scheme. It is a subfunctor of $W = \prod_{i = 1}^\infty \mathbf{A}^2$, so if $X$ is an affine scheme, it is locally closed in $W$. But this means $X$ can be defined in $W$ using only finitely many of the variables, which is impossible.