The very meaning of a dimension is a perpindicular direction, or degree of freedom that something has. In order for something to be considered a dimension, it must be orthogonal.
For example, consider the space formed by the vectors
a=(1,0,0,0), b=(0,1,0,0), c=(0,0,1,0), t=(0,0,0,1)
To find out these vectors are orthonormal (perpendicular) we must take the inner product space.
<a|b> = Σni=1αi*βi Is the general innerproduct space of vectors a and b. The alpha and beta are merely the coefficients in the vectors a and b repsectively. The * denotes a complex conjugate, which is needed if we are working in the complex space. But here we are not.
Since we have 4 vectors, we wish to check if the vectors are all mutually perpindicular or if they are not.
<a|b|c|d> = Σni=1αiβiγiδi
In other words the sum of the products of the coefficients of the vectors of the ith term.
So we have 1*0*0*0 + 0*1*0*0 + 0*0*1*0 + 0*0*0*1 = 0. All four vectors have an orthonormal inner product space. Hence we have 4 degrees of freedom, and four dimensions.
However, in quantum mechanics, time is regarded more as a parameter since it lacks a degree of freedom. This can be accounted for by saying that it is perpindicular, but on another space, an imaginary space, and is hence why one often sees the time dimension as a negative quantity when squared, or with an i next to it.
ex.
ds2 = dx2 + dy2 + dz2 -c2dt2