More generally, how to compute dimension of a space of k-planes in some quadric hypersurface (or any hypersurface) Q⊂ℙn and whether it is irreducible or not?
Let $X \subset \mathbb{P}^{n}_{k}$ be a (non-singular) projective variety over a closed field $k$.
Then $X = V(J)$ is the zero locus of some subset of polynomials $ J \subset k[X_{1}, \dots, X_{n}]$.
We want to study the relationship between the geometric properties of the surface $ X = V(S)$ and the algebraic properties of the commutative polynomial ring $R = k[X_{1}, \dots, X_{n}]$.
So $V(J) = \{(a_{1}, \dots, a_{n}) \, \colon \,\forall f_{i} \in J \, , \, f_{i}(a_{1}, \dots, a_{n}) = 0\}.$
This is a set-theoretic way of describing the thing, but with a bit of commutative algebra -- life becomes much easier.
The set of polynomials $J \subset R$ giving structure to our variety is, of course, an ideal in the of polynomials over $k$, which is (by definition) the subring containing all finite sums of the form $\sum \, f_{i} \, g_{i} \, \, \textrm{for } \,f_{i} \in J \, , \, g_{i} \in R.$
If the ideal can be written as the union of two non-trivial subsets $J = J_{1} \cup J_{2}$, then it is reducible -- in which case, the variety is said to be reducible. Otherwise, they are both irreducible.
This vocabulary corresponds to the topological notion of reducibility, which we make sense of by constructing the Zariski Topology.
Proposition: An algebraic variety $X$ is irreducible if and only if $I(X)$ is a prime ideal in the polynomial ring $R$.
Proving this will make it clear how to start answering your question about how to determine if a given variety is irreducible or not.
Corollary: Let $X = V(J)$, where $J = (f)$ for some irreducible polynomial $f$. Then $J = I(X)$ is a prime ideal in the polynomial ring $R$, and hence $X$ is an irreducible algebraic variety.
I recommend the following books:
(1) Undergraduate Algebraic Geometry [Miles Reid]
(2) Ideals, Varieties and Algorithms [Cox, Little, O'Shea]
(3) Computations in Algebraic Geometry with Macualay2 [Eisenbud, Grayson, Stillman]
http://www.math.uiuc.edu/Macaulay2/Book/
http://www.math.uiuc.edu/Macaulay2/doc/Macaulay2-1.4/share/doc/Macaulay2/Macaulay2Doc/html/toc.html
It may also be instructive to use Macaulay2 for some actual computations of dimension, codimension and prime decomposition of ideals/varieties. This is a good way to "see for yourself" the contravariance of the functor between $V(J)$ (algebraic subsets) and $I(X)$ (ideals). You can use the decompose() function to check the decomposition of an ideal, and dim()/codim() to check dimension/codimension of some given space.