Definition
Let $K$ be a quadratic number field.
Let $\mathcal{O}_K$ be the ring of algebraic integers in $K$.
By Lemma 4 in my answer to this question, there exists a unique square-free integer $m$ such that $K = \mathbb{Q}(\sqrt m)$.
If $m \equiv 1$ (mod $4$), let $\omega = (1 + \sqrt m)/2$.
If $m \equiv 2, 3$ (mod $4$), let $\omega = \sqrt m$.
By Lemma 6 in my answer to this question, $1, \omega$ is a basis of $\mathcal{O}_K$ as a $\mathbb{Z}$-module.
We call $1, \omega$ the canonical integral basis of $K$.
Lemma 1
Let $K$ be a quadratic number field.
Let $1, \omega$ be the canonical integral basis of $K$.
Let $f \gt 0$ be a positive integer.
Then $R = \mathbb{Z} + \mathbb{Z}f\omega$ is an order of $K$.
Proof:
Let $\mathcal{O}_K$ be the ring of integers in $K$.
It suffices to prove that $R$ is a subring of $\mathcal{O}_K$.
$(f\omega)^2 = f^2 \omega^2 \in f^2\mathcal{O}_K \subset R$.
Hence $f\omega R \subset R$.
Hence $R^2 \subset R$.
Hence $R$ is a subring of $\mathcal{O}_K$.
Lemma 2
Let $K$ be a quadratic number field.
Let $1, \omega$ be the canonical integral basis of $K$.
Let $R$ be an order of $K$.
Then there exists an integer $f \gt 0$ such that $1, f\omega$ is a basis of $R$ as a $\mathbb{Z}$-module.
Proof:
Let $\mathcal{O}_K$ be the ring of integers in $K$.
Let $n$ be the order of the abelian group $\mathcal{O}_K/R$.
Then $n$ is finite and $n\mathcal{O}_K \subset R$.
Hence $n\omega \in R$.
Let $f$ be the least positive integer such that $f\omega \in R$.
Let $\alpha$ be an element of $R$.
Since $R \subset \mathcal{O}_K$, there exist rational integers $a, b$ such that $\alpha = a + b\omega$.
Let $b = fq + r$, where $q$ and $r$ are rational integers and $0 \le r \lt f$.
Then $\alpha - qf\omega = a + r\omega$.
Hence $r\omega \in R$.
Hence $r = 0$ by the assmption on $f$.
Hence $\alpha \in \mathbb{Z} + \mathbb{Z}f\omega$.
Hence $R \subset \mathbb{Z} + \mathbb{Z}f\omega$.
The other inclusion is clear.
Proposition
Let $K$ be a quadratic number field.
Let $\mathcal{O}_K$ be the ring of algebraic integers in $K$.
Let $f \gt 0$ be a positive integer.
Then there exists a unique order $R$ of $K$ such that $f$ is the order of the group $\mathcal{O}_K/R$.
Moreover, the discriminant of $R$ is $f^2 d$, where $d$ is the discriminant of $K$.
Proof:
Let $1, \omega$ be the canonical integral basis of $K$.
By Lemma 1, $R = \mathbb{Z} + \mathbb{Z}f\omega$ is an order of $K$.
Clearly $f$ is the order of the group $\mathcal{O}_K/R$.
Next we will prove the uniqueness of $R$.
Let $S$ be an order of $K$ such that $f$ is the order of the group $\mathcal{O}_K/S$.
By Lemma 2, there exists an integer $g \gt 0$ such that $1, g\omega$ is a basis of $S$ as a $\mathbb{Z}$-module. Since $g$ is the order of the group $\mathcal{O}_K/S$, $f = g$.
Hence $R = S$.
Let $\omega'$ be the conjugate of $\omega$.
Then the discriminant of $R$ is $(f\omega - f\omega')^2 = f^2(\omega - \omega')^2 = f^2 d$.
Best Answer
The discriminant has a geometric interpretation as squared volume. The analogy to have in mind is that the pairing $(x,y) \mapsto {\rm Tr}_{E/F}(xy)$ in a finite extension of fields $E/F$ is analogous to the pairing $(v,w) \mapsto v \cdot w$ for vectors $v$ and $w$ in ${\mathbf R}^n$. The trace pairing is an $F$-bilinear mapping $E \times E \rightarrow F$ while the dot product is an ${\mathbf R}$-bilinear mapping ${\mathbf R}^n \times {\mathbf R}^n \rightarrow {\mathbf R}$.
If an $n$-dimensional box in ${\mathbf R}^n$ has a vertex at the origin and its edges coming out of the origin are $v_1, \dots, v_n$, then the traditional way of describing the volume uses the matrix with the $v$'s as the columns: the volume is $|\det A|$ where $A = [v_1 \cdots v_n]$ is the $n \times n$ matrix whose $j$th column is $v_j$. The product $A^\top{A}$ has $(i,j)$ entry $v_i \cdot v_j$, and its determinant is $\det(A^\top{A}) = \det(A^\top)\det(A)$, which is $\det(A)^2$. Therefore the volume of the box is $\sqrt{\det(A^\top{A})} = \sqrt{\det(v_i \cdot v_j)}$. So we have two formulas for the volume of that box: $$ {\rm volume} \ = \det[v_1 \cdots v_n] = \sqrt{\det(v_i \cdot v_j)}. $$ Therefore $$ {\rm volume}^2 \ = \det(v_i \cdot v_j). $$
Replacing $n$-dimensional Euclidean space with a finite extension of fields $E/F$ of degree $n$ and a basis $v_1,\dots,v_n$ of ${\mathbf R}^n$ with a basis $e_1,\dots,e_n$ of $E/F$, then the analogue of $\det(v_i \cdot v_j)$ is $\det({\rm Tr}_{E/F}(e_ie_j))$, which is the discriminant of the basis.
As one example of this analogy at work, any two bases of $E/F$ have their discriminants related by a nonzero square factor (namely the square of the determinant of the change-of-basis matrix), and this is analogous to the squared volume of two boxes in ${\mathbf R}^n$ being related to each other by the square of the determinant of the change-of-basis matrix. The algebraic calculations underlying both results are very similar (some may even say it's the same calculation).
As another example of the analogy at work, $\det(v_i \cdot v_j)$ and $\det({\rm Tr}_{E/F}(e_ie_j))$ both make sense even if the $v_i$'s and $e_i$'s are not bases, and in that case the numbers are $0$. If the $v_i$'s are linearly dependent then the "box" they span is lower than $n$-dimensional, so it makes geometric sense that $\det(v_i \cdot v_j)$ is $0$ because the $n$-dimensional volume of the box is $0$. If $v_1,\dots, v_n$ is a basis then $\det(v_i \cdot v_j)$ is not $0$ since the the box spanned by the $v_i$'s is $n$-dimensional, so the box has nonzero volume. Is $\det({\rm Tr}_{E/F}(e_ie_j))$ nonzero if $e_1,\dots,e_n$ is a basis of $E/F$? This algebraic question is more subtle than the situation with vectors in ${\mathbf R}^n$. If the trace function ${\rm Tr}_{E/F}$ is not identically zero on $E$ then $\det({\rm Tr}_{E/F}(e_ie_j)) \not= 0$ when the $e_i$'s are a basis, but if the trace is identically $0$ then of course $\det({\rm Tr}_{E/F}(e_ie_j)) = 0$ for any $e_i$'s at all. For number fields, or more generally any fields of characteristic $0$, the trace is not identically $0$ since ${\rm Tr}_{E/F}(1) = [E:F] \not= 0$ in $F$. More generally, the trace is not identically $0$ if and only if $E/F$ is a separable field extension.