The $x$ axis actually shows real (gross) output not GDP per se. Real GDP is an estimate of real output. Only if you assume no measurement error and if you assume away gray economy and black economy real output becomes equal to real GDP.
Aggregate demand measures the demand for total real output and aggregate supply measures the supply of total real output.
Aggregate demand is literally given by:
In turn the (some of the) variables on LHS are also functions of price level which justifies plotting AD on a graph with Price on y-axis and real output on x-axis.
Long run aggregate supply is the real production of all goods given by:
Where $f(.)$ is a production function, that is function of some inputs. Since long run AS is not function of price level it will be plotted as vertical line.
In short run however, $Y$ is also function of $P$ and that’s why the short run supply will be plotted as increasing function of price level.
It’s called aggregate demand and aggregate supply graph because it literally plots the aggregate supply and aggregate demand.
Aggregate demand and supply are not expressed in terms of simple quantity produced like in 101 microeconomics.