Minimal structure imposed on sets to define "dimension"
It doesn't make sense to talk about the dimension of a mere set - the only structural property a set has is its cardinality. And this is very little structure indeed (after all, $\vert\mathbb{R}\vert=\vert\mathbb{R}^2\vert$).
The weakest common type of structure which suffices to have some nontrivial notion(s) of dimension is a topology. Vaguely speaking, from a geometric perspective a mere topology grants much less information (and permits many more pathologies) than a metric, and from an algebraic perspective there is in general no algebraic structure fitting nicely on an arbitrary topological space. So topological spaces are pretty minimal, in the structure department, and consequently topological notions of dimension seem quite relevant.
Expanding on Alessandro Codenotti's comment above, here are two purely topological notions of dimension. (The standard text on topological dimensions is Engelking's Dimension theory.)
Inductive dimension. There are actually two of these, the large and small inductive definitions; I'll define the small one ($ind$) here since I think it's simpler. The idea is that a sign that something is $(n+1)$-dimensional is that its open sets often have $n$-dimensional boundary. This suggests the following (unsurprisingly, inductive) definition:
$ind(X)=-1$ iff $X=\emptyset$.
Having defined when $ind(X)=n$, we say $ind(X)=n+1$ iff for each point $a\in X$ and open $U\ni a$ there is an open $V\ni a$ with $cl(V)\subseteq U$ and $ind(\partial V)\le n$ (where $\partial S$ is the boundary of $S$).
Covering dimension. This notion arises when we think about how dimension interacts with "overlaps" created when we try to efficiently cover the space by small open sets. E.g. in two dimensions, if we tile $\mathbb{R}^2$ with a bunch of open balls we can arrange that at no point do four or more of the balls overlap, but we can't avoid three overlapping balls. The formal definition is a bit of a mouthful: it says that $dim_{cov}(X)=n+1$ iff for every open cover $\mathcal{C}$ of $X$ there is an open cover $\mathcal{D}$ of $X$ such that
each element of $\mathcal{D}$ is a subset of some (perhaps more than one) element of $\mathcal{C}$, and
each $x\in X$ is in at most $n+1$ many distinct elements of $\mathcal{D}$.
Each definition correctly computes the dimension of $\mathbb{R}^k$. For general spaces they can behave rather differently however, and of course there are spaces which do not get assigned a finite dimension in either sense.
In the category of sets, $\mathbb R$ and $\mathbb R^2$ are isomorphic, so as sets they cannot have different dimension.
There are several ways to give $\mathbb R$ and $\mathbb R^2$ a structure that has a notion of dimension: for example, you can obtain the dimension from the $\mathbb R$-vector space structure, or a metric, or the topology. There are lots of derivative structures of those things that still contain enough information to determine the dimension: for example, the incidence structure of lines, or the unit distance relation, or the group of isometries, or the visual boundary, or the space of continuous real-valued functions, etc.
Those structures I gave are all more or less related, but you can't really say that one is more "minimal" than the other. But here's a structure that provides truly minimal information while allowing you to determine the dimension:
Let's define a set with dimension as a tuple $(S, d)$ where $S$ is a set and $d$ is a nonnegative integer. Define the dimension of a set with dimension $(S,d)$ as $d$. Clearly $(\mathbb R, 1)$ is $1$-dimensional and $(\mathbb R^2, 2)$ is $2$-dimensional.
You probably don't like this structure though.