What are the differences among an affine variety, a vector space, and a projective variety? Are there some nice examples to explain this?
For example, what is the difference between the following: $k^n$ ($k$ is the ground field) as a vector space, and $k^n$ as an affine variety (are the equations satisfied by $k^n$). Why is $k^n$ not a projective variety?
Cf. 1st and 2nd paragraphs of Javier's answer.
To be short, the largest difference between an affine variety and a projective variety is the latter can have points at infinity. An affine space $k^n$ can also be regarded as a $k$-vector space, but a priori it is not doted with any vector space structure.
The set of equations satisfied by $k^n$ is $\emptyset$.
Why do we need to introduce projective varieties (do they have some advantages over affine varieties)?
Cf. third paragraph of Javier's answer concerning Bézout's theorem.
Why are $GL_n$ and $SL_n$ algebraic varieties? (What equations are satisfied by $GL_n$ and $SL_n$)?
If we consider $GL_n$ and $SL_n$ as subsets of $k^{n^2}$, I don't think that $GL_n$ is an algebraic variety, because it is not a closed subset under usual topology. However, when $GL_n \subset k^{n^2 + 1}$, we can identify it with the algebraic variety $\{(M,x) \mid x\det{M} = 1\}.$
As for $SL_n \subset k^{n^2}$, the answer is "yes", because it is set of zeros of the polynomial equation $\det(M) - 1 = 0$.
Are $GL_n$ and $SL_n$ projective varieties?
See below.
Can some variety be both affine and projective?
Given an affine variety, one can always complete it to a projective variety. But given a projective variety, sometimes there doesn't exist any atlas containing it to become an affine variety.