I will consider a two-dimensional set-up (which I will describe in more detail in a bit) and I will talk of a rather modest mass $m$ particle rather than a photon so that I don't have to worry if I am applying my QM correctly. There have been several debates as to whether there is even a sensible definition of the wavefunction of the photon (see this PSE post and links therein). Thankfully, those of us who don't want to bother can choose to do so because we know that we can describe photons completely nicely with QFT.
Let's say that we shoot the particle from $(0,0)$ at $t=0$, the slits are at $(l,\pm d)$ (where $l>0$) and the final screen is at $x=s>l$. Now, you ask a nice question as to when does the measurement happen? In order to answer this question, let's first consider what is our measurement. Naively, one would think that we measure as to at what location on the screen the particle is detected upon the measurement of its position. There are several issues with this claim:
- If we are measuring the position then can we detect it somewhere other than on the screen? Who is to say that whenever we measure the position of the particle, its $x$ coordinate will always be found to be such that the particle is found to be on the screen?
- One might further naively think, to escape the question posed above, that we only measure its $y$ position when it arrives at the screen. Well, then how do we know that it has arrived at the screen! The way to check if the particle is at the screen (so that we can measure its $y$ position) would be to measure its $x$ coordinate! And if we are doing that then, of course, we are back to the question raised in the previous bullet point because we are just measuring the position operator in that case. Ergo, we are clearly not doing this.
What we are doing is the following:
We are measuring a degenerate "position" operator whose non-degenerate eigensubspace comprises of the position eigenstates corresponding to the position eigenvalues of the form $(x=s,y)$ and the rest of the Hilbert space is fully degenerate. Thus, at each instant, the particle is being measured to check as to whether it is found to be on the wall or not, and if it is found on the wall then, at what position on the wall? Notice that we are not measuring the $x$ coordinate of the particle, due to the degeneracy of our operator, what we are doing is just checking if it is on the wall or not.
So, we have a probability that it will be detected at some point on the wall at each instant of time. And we can calculate it easily as I will do below.
Notice that the same story goes for what the slits are doing, they are also measuring a degenerate "position" operator but that operator is even more degenerate in that its non-degenerate eigensubspace is only two-dimensional corresponding to the two slits.
The probability amplitude that the particle is detected at a location $(s,y)$ at time $t$ is given by
\begin{align}
\psi(y,t) = \int_{t'=0}^{t'=t} dt'\ \Big[\ \langle s,y\vert e^{-i\frac{p^2}{2m}(t-t')} \vert l,d\rangle&\langle l,d\vert e^{-i\frac{p^2}{2m}t'} \vert 0, 0\rangle\\+\ \langle s,y\vert e^{-i\frac{p^2}{2m}(t-t')} \vert l,d\rangle&\langle l,d\vert e^{-i\frac{p^2}{2m}t'} \vert 0, 0\rangle\ \Big]
\end{align}
Thus, if you plot the probability of a particle getting detected at a location $y$ on the screen at time $t$, it would be given by $\vert\psi(y,t)\vert^2$. Now, you can calculate as to what is the probability that it will be detected on the screen at time $t$ to be
\begin{align}
P_t=\int dy \vert \psi(y,t)\vert^2
\end{align}
Furthermore, the average time it takes for us to detect the particle on the screen by simply calculating the probability-weighted average of arrival times as \begin{align}
T=\int dt\ t\int dy \vert \psi(y,t)\vert^2
\end{align}