Let's consider the pure Chern-Simons theory on the torus. The fundamental group $\pi_1(T^2)$ is generated by two non-contractible loops $\alpha$ and $\beta$, with the algebraic constraint $\alpha \beta = \beta \alpha$.
We'll do canonical quantization following Witten. The phase space of Chern-Simons on $T^2 \times \mathbb{R}$ consists of (conjugacy classes of) homeomorphisms from $\pi_1(T^2)$ to $G$ (where $G$ is the gauge group of Chern-Simons). In your case $G = U(1)$, which is Abelian, so the algebraic constraint $\alpha \beta = \beta \alpha$ is satisfied automatically by any such homeomorphism. Also, for an Abelian group all conjugacy classes are trivial. Hence, we can forget about the constraint and simply look for homeomorphisms $\rho$ from the free group generated by elements $\alpha$ and $\beta$ to $U(1)$. These are of course completely defined by $\rho(\alpha) \in U(1)$ and $\rho(\beta) \in U(1)$. We've established that the phase space also has the topology of the torus $U(1)^2 = T^2$ (the fact that the phase space of Chern-Simons on the torus is a torus is coincidental, there is no correspondence like this for other Riemann surfaces).
Now we need to quantize the torus. Define the two periodic coordinates $\{\varphi, \theta\} \in [0 .. 2 \pi]^2$. Any classical observable, as a function on the phase space, can be Fourier-expanded:
$$ f(\varphi, \theta) = \sum_{n = -\infty}^{\infty} \sum_{m = -\infty}^{\infty} f_{n, m} e^{i n \varphi + i m \theta} = \sum_{n,m} f_{n, m} U^n V^m,$$
where we've defined the two unitarities
$$ U(\varphi, \theta) = e^{i \varphi}, \quad V(\varphi, \theta) = e^{i \theta}. $$
Unlike $\varphi$ and $\theta$, $U$ and $V$ are well defined as functions on the phase space because they satisfy the periodic boundary conditions. Their Poisson bracket reads
$$ \left\{ U, V \right\} = - U V \left\{ \varphi, \theta \right\} = - U V / k. $$
To quantize, use for example the Kontsevich formula which greatly simplifies on the torus due to its flatness (because there exists an atlas, in fact the one given by $\varphi$ and $\theta$, for which $\partial_{\sigma} \omega^{\mu \nu} = 0$). You will end up with
$$ U V = q V U, \quad q = e^{2 \pi i / k}.$$
This $C^{*}$-algebra is known as the noncommutative torus. Its representations are also well understood. They are finite dimensional for $q$ a root of unity, which is when $k$ is an integer (or $k$ can be rational $k = n / m \in \mathbb{Q}$, but such a theory is in fact equivalent to the one with $k = \text{lcm}(n, m) = n m / \text{gcd}(n, m)$). The representation is $k$-dimensional, with $U$ and $V$ given by
$$
U=\left(\begin{array}{ccccc}
1 & 0 & 0 & \dots & 0\\
0 & q & 0 & \dots & 0\\
0 & 0 & q^{2} & \dots & 0\\
\dots & \dots & \dots & \dots & \dots\\
0 & 0 & 0 & \dots & q^{k-1}
\end{array}\right),\quad V=\left(\begin{array}{ccccc}
0 & 0 & 0 & \dots & 1\\
1 & 0 & 0 & \dots & 0\\
0 & 1 & 0 & \dots & 0\\
\dots & \dots & \dots & \dots & \dots\\
0 & 0 & 0 & \dots & 0
\end{array}\right).
$$
Now this means, of course, that $U^k = 1$.
Physically, this means that the Fourier series isn't infinite in the quantum theory as one would have expected. In fact, since $U = e^{i \varphi}$, this means that the terms in the Fourier series are equivalent with integer period $k$, i.e. the coefficients of terms $f_{n} U^n$ and $f_{n + k} U^{n + k}$ are "equivalent" in the sense that any quantity in the quantum theory can only depend on their sum.
It is convenient to label the unique coefficients by $f_n$ with $-k / 2 \lt n \le k / 2$ (assuming $k$ is even), which is the formula that you have in your question.
Finally, why does the quantization on the torus without Wilson lines give you the types of Wilson lines? This has to do with the TQFT-ness of Chern-Simons. Imagine a filled torus, i.e. a "bagel". Imagine that there's a single Wilson line inside the bagel that isn't trivially contractible. According to the TQFT axioms, this Wilson line gives you a state on the boundary – on the torus. In fact, the states of Chern-Simons on the torus and the types of Wilson lines are in 1:1 correspondence.