It is not hard to prove that for any vector space $\mathbf{V}$, if $\beta$ and $\beta'$ are two bases for $\mathbf{V}$, then the cardinality of $\beta$ equals the cardinality of $\beta'$. For finite dimensional spaces this is standard. For infinite dimensional, for each $x\in\beta$ let $\beta'_x$ be a finite subset of $\beta'$ such that $x\in\mathrm{span}(\beta'_x)$. Then $\cup\beta'_x = \beta'$, so $|\beta'|\leq \aleph_0|\beta|=|\beta|$. Now repeat the process for $y\in\beta'$ to get the other inequality. Edit: Note that this assumes the Axiom of Choice, so that we can talk about the cardinals of $\beta$ and $\beta'$. In the absence of AC, it could be that $\beta$ and $\beta'$ are "incomparable" (no injections going either way), so we cannot conclude that any two bases have the same cardinality without AC.
Fix a field $F$, and let $\mathbf{V}$ and $\mathbf{W}$ be vector spaces over $F$. Assuming the Axiom of Choice we can prove that every vector space has a basis (in fact, "Every vector space over any field has a basis" is equivalent to the Axiom of Choice). So let $\beta=\{v_i\}_{i\in I}$ be a basis for $\mathbf{V}$, and let $\gamma=\{w_j\}_{j\in J}$ be a basis for $\mathbf{W}$.
If $\mathbf{V}$ is isomorphic to $\mathbf{W}$, then let $\varphi\colon\mathbf{V}\to\mathbf{W}$ be an isomorphism. Then $\varphi(\beta)$ is a basis for $\mathbf{W}$, and since $\varphi(\beta)$ and $\gamma$ are both bases of $\mathbf{W}$, and $\varphi$ is a bijection, you have $|\beta|=|\varphi(\beta)|=|\gamma|$. So if $\mathbf{V}$ and $\mathbf{W}$ are isomorphic, then they have bases of the same cardinality.
Conversely, suppose $|\beta|=|\gamma|$. Let $f\colon\beta\to\gamma$ be a bijection, and let $\varphi\colon \mathbf{V}\to\mathbf{W}$ be the unique linear transformation that extends $f$ (that is, extend $f$ linearly to all of $\mathbf{V}$). Since $\varphi(\mathbf{V}) = \varphi(\mathrm{span}(\beta)) = \mathrm{span}(\varphi(\beta)) = \mathrm{span}(f(\beta)) = \mathrm{span}(\gamma)=\mathbf{W}$, then $\varphi$ is onto. It is straightforward to verify that $\varphi$ is one-to-one (it takes a basis to a basis). So $\varphi$ is an isomorphism. Thus, if $\mathbf{V}$ and $\mathbf{W}$ have bases of the same cardinality, then $\mathbf{V}$ is isomorphic to $\mathbf{W}$.
Thus, two vector spaces over the same field are isomorphic if and only if they have bases of the same cardinality, if and only if they have the same dimension (assuming the Axiom of Choice).
In particular, $\mathbb{R}$ and $\mathbb{C}$ are isomorphic as vector spaces over $\mathbb{Q}$, since they both have dimension $2^{\aleph_0}$. But you have to specify over what field you are working: $\mathbb{R}$ and $\mathbb{C}$ are not isomorphic as vector spaces over $\mathbb{R}$ (dimensions 1 and 2, respectively)!.
Now is a very good time for a quick foray into the ideal-theoretic version of Sun-Ze (better known as the Chinese Remainder Theorem). Let $R$ be a commutative ring with $1$ and $I,J\triangleleft R$ coprime ideals, i.e. ideals such that $I+J=R$. Then
$$\frac{R}{I\cap J}\cong\frac{R}{I}\times\frac{R}{J}.$$
First let's recover the usual understanding of SZ from this statement, then we'll prove it. Thanks to Bezout's identity, $(n)+(m)={\bf Z}$ iff $\gcd(n,m)=1$, so the hypothesis is clearly analogous. Plus we have $(n)\cap(m)=({\rm lcm}(m,n))$. As $nm=\gcd(n,m){\rm lcm}(n,m)$, if $n,m$ are coprime then compute the intersection $(n)\cap(m)=(nm)$. Thus we have ${\bf Z}/(nm)\cong{\bf Z}/(n)\times{\bf Z}/(m)$. Clearly induction and the fundamental theorem of arithmetic (unique factorization) give the general algebraic version of SZ, the decomposition ${\bf Z}/\prod p_i^{e_i}{\bf Z}\cong\prod{\bf Z}/p_i^{e_i}{\bf Z}$.
(How this algebraic version of SZ relates to the elementary-number-theoretic version involving existence and uniqueness of solutions to systems of congruences I will not cover.)
Without coprimality, there are counterexamples though. For instance, if $p\in\bf Z$ is prime, then the finite rings ${\bf Z}/p^2{\bf Z}$ and ${\bf F}_p\times{\bf F}_p$ (where ${\bf F}_p:={\bf Z}/p{\bf Z}$) are not isomorphic, in particular not even as additive groups (the product is not a cyclic group under addition).
Now here's the proof. Define the map $R\to R/I\times R/J$ by $r\mapsto (r+I,r+J)$. The kernel of this map is clearly $I\cap J$. It suffices to prove this map is surjective in order to establish the claim. We know that $1=i+j$ for some $i\in I$, $j\in J$ since $I+J=R$, and so we further know that $1=i$ mod $J$ and $1=j$ mod $I$, so $i\mapsto(I,1+J)$ and $j\mapsto(1+I,J)$, but these latter two elements generate all of $R/I\times R/J$ as an $R$-module so the image must be the whole codomain.
Now let's work with ${\cal O}={\bf Z}[i]$, the ring of integers of ${\bf Q}(i)$, aka the Gaussian integers. Here you have found that $(2)=(1+i)(1-i)=(1+i)^2$ (since $1-i=-i(1+i)$ and $-i$ is a unit), that the ideal $(3)$ is prime, and that $(5)=(1+2i)(1-2i)$. Furthermore $(1+i)$ is obviously not coprime to itself, while $(1+2i),(1-2i)$ are coprime since $1=i(1+2i)+(1+i)(1-2i)$ is contained in $(1+2i)+(1-2i)$. Alternatively, $(1+2i)$ is prime and so is $(1-2i)$ but they are not equal so they are coprime. Anyway, you have
- ${\bf Z}[i]/(3)$ is a field and
- ${\bf Z}[i]/(5)\cong{\bf Z}[i]/(1+2i)\times{\bf Z}[i]/(1-2i)$ is a product of fields.
Go ahead and count the number of elements to see which fields they are. However, ${\bf Z}[i]/(2)={\bf Z}[i]/(1+i)^2$ is not a field or product of fields, although the fact that its characteristic is prime (two) may throw one off the chase. In ${\bf Z}[i]/(1+i)^2$, the element $1+i$ is nilpotent. Since this ring has order four, it is not difficult to check that it is isomorphic to ${\bf F}_2[\varepsilon]/(\varepsilon^2)$, which is not a product of fields since $\epsilon\leftrightarrow 1+i$ is nilpotent and products of fields contain no nonzero nilpotents.
Best Answer
More generally: suppose $d$ and $d'$ are both squarefree integers, both different from $1$, and consider $F_1 = \mathbb{Q}(\sqrt{d})$ and $F_2 = \mathbb{Q}(\sqrt{d'})$.
They are both isomorphic as $\mathbb{Q}$-vector spaces, since they are both of dimension $2$; or more explicitly, every element of $F_1$ can be written uniquely as $a+b\sqrt{d}$ with $a,b\in\mathbb{Q}$ (unique because $\sqrt{d}\notin\mathbb{Q}$), and every element of $F_2$ can be written uniquely as $x+y\sqrt{d'}$ with $x,y\in\mathbb{Q}$. The map $f\colon F_1\to F_2$ given by $f(a+b\sqrt{d}) = a + b\sqrt{d'}$ is additive and $\mathbb{Q}$-homogeneous, clearly bijective, so $F_1$ and $F_2$ are isomorphic as vector spaces over $\mathbb{Q}$.
However, they are never isomorphic as fields; clearly, $d$ is a square in $F_1$. I claim $d$ can only be a square in $F_2$ if $d=d'$. Indeed, if$(x+y\sqrt{d'})^2 = d$. That means that $x^2 + d'y^2 + 2xy\sqrt{d'} = d$, hence $2xy = 0$ and $x^2+d'y^2=d$. If $x=0$, then $d=d'y^2$, so clearing denominators you get $da^2 = d'b^2$ for some $a,b\in\mathbb{Z}$, $\gcd(a,b)=1$; since both $d$ and $d'$ are squarefree, it follows that $|a|=|b|=1$, so $d=d'$. If $y=0$, then $d=x^2$, so $d$ is the square of a rational, contradicting the fact that it is a squarefree integer different from $1$. Thus, of $d$ is a square in $F_2$, then $d=d'$. Hence, if $F_1\cong F_2$, then $d=d'$ (converse is immediate).
Now, since every quadratic extension of $\mathbb{Q}$ is equal to $\mathbb{Q}(\sqrt{d})$ for some squarefree integer $d$ different from $1$, you conclude that any two quadratic extensions are either identical or not isomorphic as fields.