It is well known that the set of functions $\left\{ e^{^{inx}}\right\}$, for integer $n$, is an othonormal basis for the space of square integrable real functions in the interval $[-\pi,\pi]$.
Now let $\left\{ k_{n}\right\}$ be a sequence of real numbers and consider the set of functions $\left\{ e^{ik_{n}x}\right\}$. For what sequences $\left\{ k_{n}\right\}$ do the functions $\left\{ e^{ik_{n}x}\right\}$ form a basis (not necessarily orthonormal) for the space of square integrable real functions in some interval (not necessarily $[-\pi,\pi]$)?
Thanks.
The question originally asked about infinite intervals, but the functions $e^{ikx}$ aren't square integrable over infinite intervals, so they can't form a basis for $\mathcal L ^2(\mathbb R)$. The analogous object for infinite intervals is the Fourier transform.
For finite intervals, the key phrase to search for is nonharmonic fourier series. There are entire books dedicated solely to this subject, but one can start with the 1952 paper by Duffin & Schaefer. There they introduce the notion of a frame, which can be easier to work with than a basis.
Another topic to search for is nonuniform sampling. By inverting the roles of the time domain and frequency domain, one can show that your question is equivalent to "What sets of samples are sufficient to reconstruct a bandlimited function?". From an article on nonuniform sampling by Aldroubi and Gröchenig:
(Kadec's original paper is in Russian.) Converting to your notation: the collection $\{e^{ i k_n x}: n \in \mathbb Z\}$ is a Riesz basis of $\mathcal L^2(−\pi, \pi)$ if for all $n \in \mathbb Z$, $|k_n-n|\le L <1/4$. In other words, if you perturb the frequencies slightly from the integers, you still get a basis. This isn't a necessary condition, but see the literature if you're interested in more general conditions.