Combining Henning's and my comments and expanding them slightly:
The spaces whose topology consists of clopen sets only are precisely the disjoint unions of spaces with the trivial topology.
Let $X$ be a space whose topology $\tau$ consists of clopen sets only. Note that $\tau$ is stable under arbitrary unions and complements, hence it is also stable under arbitrary intersections.
Define a relation $\sim$ on $X$ as follows: $x \sim y$ if and only if for all clopen sets $U$ we have either $\{x,y\} \subset U$ or $\{x,y\} \cap U = \emptyset$.
This is obviously a reflexive and symmetric relation. It is also transitive: Suppose $x \sim y$ and $y \sim z$. Consider an arbitrary clopen set $U$. By definition of $x \sim y$ there are only two possibilities:
- If $\{x,y\} \cap U = \emptyset$ then we must have $\{y,z\} \cap U = \emptyset$ since $y \sim z$, hence $\{x,z\} \cap U = \emptyset$.
- If $\{x,y\} \subset U$ then we must also have $\{y,z\} \subset U$ since $y \sim z$ and hence $\{x,z\} \subset U$.
Thus $x \sim z$ and the relation is transitive.
Write $[x]$ for the $\sim$-equivalence class of $x$. We have just seen that for each clopen $U$ we either have $[x] \subset U$ or $[x] \cap U = \emptyset$. Thus each clopen set $U$ is a union of equivalence classes. If $x \not \sim y$ then there exists a clopen set $V$ such that $[x] \subset V$ and $[y] \cap V = \emptyset$. Thus $[x]$ is the intersection of the clopen sets containing it and hence it is clopen as well. Since each clopen set either intersects $[x]$ trivially or must contain it, the relative topology on $[x]$ is the trivial topology. Since $X$ is partitioned into equivalence classes, it follows that $X$ is a disjoint union of spaces with the trivial topology.
Conversely, if $X$ is a disjoint union of spaces with the trivial topology then it has the desired property.
Finally, as Henning observed, every equivalence relation on $X$ endows $X$ with a topology consisting of clopen sets only: the topology generated by the equivalence classes. The identity relation gives the discrete topology and the trivial relation $X \times X$ gives the trivial topology. Every other equivalence relation gives a topology as you're asking for.
Added: From your comment I learned that this is called the partition topology by Steen and Seebach in Counterexamples in Topology and appears as Example 5 on page 43.