In Hatcher, a CW complex is defined by inductively attaching cells, where we begin with $X^0$, a discrete space and then attach $1$-cells etc. We then get spaces $X^0,X^1,\cdots$ where $\iota_{i,i+1}:X^i \hookrightarrow X^{i+1}$ is an embedding. The resulting space is then defined to be $$ X = \bigcup_{n=0}^\infty X^n, $$ where a subset $U \subset X$ is open iff $U \cap X^n$ is open, for all $n$.
My question: Is this union really a union or a colimit in the category $\mathsf{Top}$, where $X$ then would be defined by $$ X = \left (\bigsqcup_{n=0}^\infty X^n \right )/\sim $$ where $(x,i) \sim (\iota_{i,i+k}(x),i+k) \ (k\geq 1)$, when $\iota_{i,i+k}$ is the inclusion of $X^i$ into $X^{i+k}$. If we call $\kappa_i: X^i \to X$, with $X$ the quotient of the direct sum, then $X$ carries the final topology wrt. those $\kappa_i$. Does the statement $U \subset X$ open iff $U \cap X^n$ open make sense ?
I am not quite sure how I have to understand the inductive definition of a CW complex.
The definition of $X$ is indeed as the colimit you describe. Writing it as a union is just a mild abuse of notation: via the map $\iota_{i,i+k}:X^i\to X^{i+k}$, we may consider $X^i$ to be a subset of $X^{i+k}$. Indeed, if you really want to you can even define the spaces $X^i$ carefully such that this is literally true, and the $\iota$ maps are just inclusion maps. Alternatively, once you have constructed the set $X$, you can identify $X^i$ with its image under $\kappa_i$, and in this way you can think of all of the $X^i$ as a sequence of nested subsets of $X$. If you don't make such identifications to consider the $X^i$ to literally be subsets of $X$, then $U\cap X^n$ should be read as a shorthand for $\kappa_n^{-1}(U)$.
These abuses of notation are extremely common throughout mathematics: this is really no different from thinking of $\mathbb{Z}$ as a subset of $\mathbb{Q}$, even though perhaps technically $\mathbb{Q}$ is defined as a set of equivalence classes of ordered pairs of integers.