Well,think about what it means to have a basis for a vector space V over a field F. A basis B is a set of vectors in V for which for every vector v in V, there exists S= ${v_1,v_2,.....v_n}\subseteq B$ and ${a_1,a_2,...,a_n}\in F$ such that $\sum_{i=1}^n a_iv_i = v$ and $\sum_{i=1}^n a_iv_i = 0$ iff for every $i$, $a_i=0$. So let's check. Let U be a subspace of V and consider the quotient space V\U. Consider $S'= S + U\subseteq V/U $ and let's see if this is a basis for V/U. Let's see if it spans V/U. For every $u\in V/U$, u = v + w where v is an arbitrary vector in V where $u-v=w\in U$. Since B is a basis for V, there exists ${v_1,v_2,.....v_i}\in B$ and ${a_1,a_2,...,a_i}\in F$ where $1\leq i \leq n$ such that u = $\sum_{j=1}^i a_jv_j$. Also, since B is a basis for V and U is a subspace of V, there exists ${v_1,v_2,.....v_k}\in B$ and ${b_1,b_2,...,b_k}\in F$ such that for every $w\in U$, w = $\sum_{l=1}^k b_lv_l$ where $1\leq k \leq n$. But this means u = v + w = $\sum_{j=1}^i a_jv_j$ + $\sum_{l=1}^k b_lv_l$ = $\sum_{m=1}^{j+l}(a_j + b_l)v_m$ where $1\leq j+l \leq n$ . But this means S' spans V/U. Since for every m where $1\leq m\leq n$, $v_m\in B$, then $\sum_{i=1}^m a_iv_i = 0$ iff for every $i\leq m$, $a_i=0$. But that means S' is a linearly independent set of vectors in V and that means S' is a basis for V/U. Q.E.D.
The notation of my proof in the indices may be a little sloppy. I'll go over it later, but the basic logic is correct.
Hint:
Te first step is to determine if the given subset is really a vector space, this means that it have to be closed under the addition and the scalar product, and contains the zero vector and the opposite of his elements.
Than, to find his dimension, we have to find a basis for this subspace, and the number of vectors in this basis is the dimension. The way to do this is, in general, different, for different vector spaces.
As an example, for your case $V_1$, we can see that any diagonal matrix can be expressed as:
$$
\begin{bmatrix}
a&0&0\\
0&b&0\\
0&0&c
\end{bmatrix}=
a\begin{bmatrix}
1&0&0\\
0&0&0\\
0&0&0
\end{bmatrix}
+b\begin{bmatrix}
0&0&0\\
0&1&0\\
0&0&0
\end{bmatrix}
+c\begin{bmatrix}
0&0&0\\
0&0&0\\
0&0&1
\end{bmatrix}=
ae_{11}+be_{22}+ce_{33}
$$
where the three matrices $e_{11},e_{22},e_{33}$ on LHS are linearly independent, so the dimension of $V_1$ is $3$.
Can you do something similar for the other cases?
Note that in the example the kay fact is that three matrices that are a basis for the space $V_1$, and, by definition, the dimension of a vector space is the cardinality of a basis.
The comment of @Abstraction points out that a vector space is well defined only if we specifies not only the set of vectors (the set $V_1$ in this case) but also the field of scalars used for the scalar product. So, as an example the set of complex numbers $\mathbb{C}$ can be seen as a vector space over the field $\mathbb{C}$, and in this case it has dimension $1$, or over the field $\mathbb{R}$, and in this case has dimension $2$ or over $\mathbb{Q}$ and in this case his dimension is uncountably infinite. Anyway the given definition of dimension is the same: the cardinality of a basis. And I suppose thet the OP refers to the simpler and common case of vector spaces over $\mathbb{R}$.
For $V_2$, as another example, we can easily see that a basis for lower triangular matrices on $M_3(\mathbb{R})$ is:
$$
\begin{bmatrix}
1&0&0\\
0&0&0\\
0&0&0
\end{bmatrix}
\quad
\begin{bmatrix}
0&0&0\\
1&0&0\\
0&0&0
\end{bmatrix}
\quad \begin{bmatrix}
0&0&0\\
0&1&0\\
0&0&0
\end{bmatrix}
\quad
\begin{bmatrix}
0&0&0\\
0&0&0\\
1&0&0
\end{bmatrix}
\quad\begin{bmatrix}
0&0&0\\
0&0&0\\
0&1&0
\end{bmatrix}
\quad
\begin{bmatrix}
0&0&0\\
0&0&0\\
0&0&1
\end{bmatrix}
$$
and this means that the dimension of $V_2$ is $6$
In a similar way, a basis for $V_3$ is done by the monomials $\{1\},\{x^3\}$, so the dimension of $V_3$ is $2$.
For $V_4$ note that a polynomial of $P_3$ such that $p(1)=0$ has the form: $(x-1)(ax^2+bx+c)=ax^3+b(x^2-x)+c(x-1)$ and, since $x^3,(x^2-x),(x-1)$ are linearly independent they form a basis of $V_4$ and its dimension is $3$.
Best Answer
Hint. Let $\textsf W$ be a subspace of a finite-dimensional vector space $\textsf V$. If $\{ w_1,\dots,w_k\}$ is a basis for $\textsf W$ and $\{w_1,\dots,w_k,w_{k+1},w_{k+2}\dots,w_n\}$ an extension of this basis to a basis for the whole space $\textsf V$, then $$\{w_{k+1}+\textsf{W}, w_{k+2}+\textsf{W}, \dots, w_n+\textsf{W}\}$$ form a basis for the quotient space $\textsf{V}/\textsf{W}$.