The concept of dimension is surprisingly subtle. The mathematics invented by Georg Cantor and his contemporaries famously showed that, contrary to intuition, it is possible to specify a point in $2$-dimensional space using only a single real number. To make this precise, we need the concept of a bijective function. What Cantor's mathematics shows is that, contrary to intuition, there exist (many) bijections $$\mathbb{R} \rightarrow \mathbb{R} \times \mathbb{R}.$$
In some sense, this is saying that the set $\mathbb{R} \times \mathbb{R}$ is (rather paradoxically) "no bigger" than $\mathbb{R}$.
To make matters worse, Giuseppe Peano (born 13 years after Cantor) managed to construct a space-filling curve; a continuous function $$[0,1] \rightarrow [0,1] \times [0,1]$$ that, rather miraculously, manages to be surjective.
What this all means is that, like I said, the concept of dimension is rather subtle. One might speculate that fundamentally, this concept actually makes no sense. The good news is that, in fact, the concept of dimension does make sense. The bad news is that the definition is pretty complicated, and needs to be built up in two stages.
In the first stage, we establish the concept of dimension in linear algebra.
We need the following notions:
The definition is:
Proposition 0. Let $V$ denote a vector space. Then $V$ has a basis, and every two bases of $V$ have the same number of elements, and (Definition.) we call this number the dimension of $V$.
Example. The dimension of the vector space $\mathbb{R}^n$ is $n$.
Note that, in full generality, the dimension of $V$ is a cardinal number, a concept invented by Cantor to tame the chaos of infinite sets. However, for the purposes of basic geometry, we can usually assume that $V$ is finite-dimensional, in which case the dimension of $V$ will always be a natural number.
In the second stage, we establish the concept of dimension in differential geometry. This part is much more complicated.
We'll need the following concepts:
Definition. Let $M$ denote a smooth manifold and $x$ denote an element of $M$. Then the dimension of $M$ at $x$ is, by definition, the dimension of the tangent space of $M$ at $x$, viewed as a vector space.
It turns out that
Proposition 1. Let $M$ denote a manifold. If $M$ is connected, then there exists a natural number $n$ such that for all points $x$ in $M$, the dimension of $M$ at $x$ equals $n$, and (Definition.) we call $n$ the dimension of $M$.
Example. The dimension of the manifold $\mathbb{R}^n$ is $n$.
To finally answer your question, we'll need two more concepts:
Now:
- the open interval $A=(0,1)$ can be viewed as a submanifold of $\mathbb{R}$
- the open square $B=(0,1) \times (0,1)$ can be viewed as a submanifold of $\mathbb{R}^2$
- the unit circle $C = \{x \in \mathbb{R}^2 : \|x\|=1\}$ can viewed as a submanifold of $\mathbb{R}^2$.
This implies that each of $A,B$ and $C$ can be viewed as manifolds in their own right. Further to this, they turn out to be connected; and, hence, they have a well-defined dimension; namely, $1,2$ and $1$ (respectively). The first two of these numbers is easy to obtain; since $A$ and $B$ are open subsets of $\mathbb{R}$ and $\mathbb{R}^2$ respectively, hence they have dimension $1$ and $2$ respectively. The dimension of $C$ is a little harder to find, because its not an open subset of $\mathbb{R}^2$. But your intuition is generally pretty trustworthy when it comes to these things; if your brain tells you that the dimension of $C$ is $1$, then the dimension of $C$ is probably $1$. Perhaps this partly explains why it took mathematics so long to give the concept of dimension a proper and rigorous treatment; perhaps its because intuition alone is usually enough to get you the right answer, even if you don't really know what that answer means in a precise, technical sense.