Let $\Omega \subset \mathbb{R}^n$ be open. The dirichlet problem is given by
\begin{align} -\Delta u &= f \text{ on } \Omega \\ u&=0 \text{ on } \partial \Omega \end{align}
for a function $f \in L^2(\Omega)$. When defining the weak solution I always saw that it was assumed that $\Omega$ is bounded and then the weak solution was defined as a function $u \in H^1_0(\Omega)$ such that $$\int \langle \nabla u, \nabla w \rangle = \int f w \text{ for all } w \in H^1_0(\Omega).$$
But does this definition still hold or even make sense if we do not assume that $\Omega$ is bounded, just that it is open?
Yes, this definition can still be used for unbounded domains. For example, it appears in the paper Dirichlet problem for a linear elliptic equation in unbounded domains with $L^2$-boundary data by Chabrowski (this is just one of search results).
One is likely to find that some theorems about weak solutions either no longer hold, or require more difficult proof; which is probably why the assumption of boundedness is made.