How to develop a spectrogram (2D array) from audio signal?
Spectrogram is obtained using Short Time Fourier Transform technique. It is used to visualize frequency changes over time. Imagine you have a very long signal whose frequency content vary with time. You can be tempted to take the FFT of this whole data. But that will not show you the variation of frequency content over time. So you will have to split your signal into smaller chunks and take FFT of each chunk. That way you will be able to see how the frequency content varies over time. This is how the 2-D array is generated. For each chunk, you get the FFT output as one single column vector(in each column as per your figure). For consecutive chunks, you place them adjacent to each other. so as you move across row, you are moving across time. 

How do you decide how to split your time signal into smaller chunks? Suppose your FFT size is $N$, you can split your whole signal into chunks of $N$ and take FFT of each without overlapping these chunks. So at time $n$, your FFT output is 
$$
X(k,n) = \sum_{m=n}^{m=n+N}x[m]e^{-j2\pi km/N}
$$
When taking FFT, we have not done any pre-processing on $x[m]$. We just did a rectangular windowing of $x[m]$ from $m=n$ to $m=n+N$ before taking FFT. But rectangular windowing is not a good windowing technique because it will increase spectral leakages. So instead of that, you will apply other windowing techniques like Hann or Hamming or Kaiser to mitigate this spectral leakage. Windowing is just point-by-point multiplication of $x[m]$. For window function $w[n]$ , $0 \le n \le N-1$,
$$
X(k,n) = \sum_{m=n}^{m=n+N}x[m]w[m-n]e^{-j2\pi km/N}
$$
For the picture you showed,
$$
\text{Column, X[:,m]} \rightarrow  \text{ Spectral Content at time index m}\\
\text{Row, X[k,:]} \rightarrow \text{ Variation of frequency index k across time index m}\\
$$
Size of windowed $x[m]$ may be less than FFT size $N$ but for simplicity I am assuming same here.

There is one more parameter while obtaining this 2-D array. I mentioned earlier that the chunks do not overlap. But if the frequency content varies fast across each chunk, you may end up getting a jagged display when you plot the spectrogram. So it is imperative to provide some amount of overlap between chunks. The overlap size is $L$. So for each time index (row), the increment would be $L/T_s$, where $T_s$ is the sampling interval. To summarize, any two consecutive columns of the 2-D spectrogram array will be computed as
$$
X_r(k,n+rL) = \sum_{m=n+rL}^{m=n+rL+N}x[m]w[m-n-rL]e^{-j2\pi km/N}\\
X_{r+1}(k,n+(r+1)L)= \sum_{m=n+(r+1)L}^{m=n+(r+1)L+N}x[m]w[m-n-(r+1)L]e^{-j2\pi km/N}
$$