  The study of high-redshift bright quasars is crucial to gather information
about the history of galaxy assembly and evolution. Variability analyses can
provide useful data on the physics of the quasar processes and their relation
with the host galaxy. In this study, we aim at measuring the black hole mass of
the bright lensed BAL QSO APM 08279+5255 at $z=3.911$ through reverberation
mapping, and at updating and extending the monitoring of its C IV absorption
line variability. Thanks to 138 R-band photometric data and 30 spectra
available over 16 years of observations, we perform the first reverberation
mapping of the Si IV and C IV emission lines for a high-luminosity quasar at
high redshift. We also cross-correlate the C IV absorption equivalent width
variations with the continuum light curve, in order to estimate the
recombination time lags of the various absorbers and infer the physical
conditions of the ionised gas. We find a reverberation-mapping time lag of
$\sim 900$ rest-frame days for both Si IV and C IV emission lines. This is
consistent with an extension of the BLR size-to-luminosity relation for active
galactic nuclei up to a luminosity of $\sim 10^{48}$ erg/s, and implies a black
hole mass of $10^{10}$ $M_\odot$. Additionally, we measure a recombination time
lag of $\sim 160$ days in the rest frame for the C IV narrow absorption system,
which implies an electron density of the absorbing gas of $\sim 2.5 \cdot 10^4$
cm$^{-3}$. The measured black hole mass of APM 08279+5255 indicates that the
quasar resides in an under-massive host-galaxy bulge with $M_{bulge} \sim 7.5
M_{BH}$, and that the lens magnification is lower than $\sim 8$. Finally, the
inferred electron density of the narrow-line absorber implies a distance of the
order of 10 kpc of the absorbing gas from the quasar, placing it within the
host galaxy.
