A dimension is a degree of freedom in which position can vary. Each degree of freedom can be indexed by a single variable, which means that the dimensionality of a space is the number of coordinates needed to specify a point in that space. For example, a solid cube requires an x, y and z coordinate to define a position within, so it is three-dimensional.
In many physical theories, dimensions can either be spatial, temporal, or compact. Spatial dimensions are typical dimensions, allowing for free movement in all directions. Temporal dimensions correspond to time, and only allow changes to propagate in one direction. Compact dimensions are small, finite and periodic, meaning that they do not have a clear extent macroscopically but alter the behavior of microscopic phenomena.
In mathematics, other notions of the word "dimension" can be considered and serve as useful for studying more complicated objects such as fractals. One of these notions is Hausdorff dimensionality. The Hausdorff dimension of a metric space is the infimum of the set of all such that the -dimensional Hausdorff measure of is 0.