Consider a continuous-time signal $$x_a(t) = A \cos(\Omega_0 t + \theta) $$ where $\Omega_0$ is the frequency, and $\theta$ is the phase.
To perform spectral analysis of $x_a(t)$, sample it with a period of $T_s$ resulting in the discrete-time sequence $$x[n] = A \cos( \omega_0 n + \theta)$$ where $\omega_0 = \Omega T_s$ is the discrete-time frequency in radians.
Consider the relationship between the CTFT $X_a(\Omega)$ of $x_a(t)$ and the DTFT $X(e^{j\omega})$ of $x[n]$ for $\omega \in [-\pi,\pi]$
$$X(e^{j\omega}) = \frac{1}{T_s} X_a(\frac{\omega}{T_s})$$
Computation of $X(e^{j\omega})$ of $x[n]$ may require indefinetely long duration of $x[n]$, such as infinite duration if $x_a(t)$ is an ideal sine wave. And also $X(e^{j\omega})$ is a function with continuous domain of $\omega$. Thus it's not practical to compute the DTFT.
However, one can compute samples $X[k]$ of $X(e^{j\omega})$, known as the DFT of $x[n]$, defined over a finite length of $x[n]$ obtained by applying a window: $$v[n] = w[n]x[n]$$ where $w[n]$ is the window of length $L$.
The consequence of this windowing on the result of the computed spectrum is: $$V(e^{j\omega}) = \frac{1}{2\pi} X(e^{j\omega}) \star W(e^{j\omega}) $$
Computing the $N$-point DFT of the sequence $v[n]$ therefore provides the samples $V[k]$ of the result of the periodical convolution between the true spectrum $X(e^{j\omega})$ of $x[n]$ and the DTFT $W(e^{j\omega})$ of the window $w[n]$. Note that $N \geq L$.
For the specific example we have considered, $$x[n]=A\cos(\omega_0 n + \theta)$$ whose DTFT is $$X(e^{j\omega})= A\pi e^{j\theta} \delta(\omega-\omega_0) + A\pi e^{-j\theta} \delta(\omega+\omega_0)$$ a pair impulses weighted by $A\pi$.
And assuming a rectangular window of length $L$ for $w[n]$, its DTFT is: $$W(e^{j\omega})= \sum_{n=0}^{L-1} w[n] e^{-j\omega n} = e^{-j{\omega (L-1)/2}} \frac{\sin(\omega L / 2)}{\sin(\omega / 2)} $$ the result is $$V(e^{j\omega}) = 0.5 A e^{j\theta} W(e^{j(\omega - \omega_0)}) + 0.5 A e^{-j\theta} W(e^{j(\omega + \omega_0)})$$
Finally the DFT samples $V[k]$ are given by the following:
$$V[k] = V(e^{j\frac{2\pi k}{N} }) = 0.5 A e^{j\theta} W(e^{j(\frac{2\pi k}{N} - \omega_0)}) + 0.5 A e^{-j\theta} W(e^{j(\frac{2\pi k}{N} + \omega_0)}) $$
One peak peak of these DFT samples would occur for $\omega = \omega_0$ for some $k$ if $\frac{2\pi k}{N} = \omega_0$ is satisfied for an integer $N$ and $k$. Assuming $T_s$ ,$L$,$N$,and $\Omega_0$ are selected such that the equality is satisfied for some integer $k_0$, then the magnitude of the peak of the observed spectrum is:
$$ |V[k_0]| = | 0.5 A e^{j\theta} W(e^{j(0)}) + 0.5 A e^{-j\theta} W(e^{j(2\omega_0)}) | $$
Solving for $A$, the amplitude of the original analog signal whose spectrum analysis are after, yields:
$$A = \frac{2 |V[k_0]|}{|e^{j\theta} W(e^{j(0)}) + e^{-j\theta} W(e^{j(2\omega_0)}) |} $$
An approximation to this can be obtained by assuming, for the rectangular window, $W(e^{j 2\omega_0}) \approx 0$ and noting that $W(e^{j0}) = L$ : $$A \approx \frac{2 |V[k_0]|}{L}$$
If a window other than rectangular is used, formulation should be adjusted accordingly, specifically $W(0)$ being the sum of the window samples, which is $L$ for the rectangular window.