Time dilation clock experiment: what would happen if the clock were flipped 90 degrees?

@WillO gives a good conceptual explanation. For completeness it's possible to show that the same time dilation results in either case.

A horizontal clock would be moving in the direction of its length, so we need to worry about length contraction as well. According to the stationary observer, the horizontal clock is $\ell^\prime = \frac{1}{\gamma}\ell$ long, and $$ \gamma = \frac{1}{\sqrt{1-\left( \frac{v}{c}\right)^2}} $$ is the Lorentz factor.

Stationary Clock

It takes the light $\Delta t = 2\ell / c$ to make a round trip for the stationary clock. Another way to put it is that the total round trip distance is $$ c\, \Delta t = 2 \ell .$$

Moving Clock

For the moving clock break the motion of the light up into two parts: the outgoing part (before reflection) and the returning part (after reflection).

outgoing time

For the outgoing part the distance traveled by the light in time $\Delta {t_\mathrm{o}}^\prime$ is $$c \, \Delta {t_\mathrm{o}}^\prime = \ell^\prime + v\,\Delta {t_\mathrm{o}}^\prime .$$

The light traveled speed $c$ for time $\Delta {t_\mathrm{o}}^\prime$. The light needed to move the length of the clock plus the amount the far end moved while the light was in transit. Anticipating the end result, rewrite this as

$$ c \, \Delta {t_\mathrm{o}}^\prime = \frac{\ell^\prime}{1-\frac{v}{c}} .$$

returning time

For the returning part the distance traveled by the light in time $\Delta {t_\mathrm{r}}^\prime$ is

$$c \, \Delta {t_\mathrm{r}}^\prime = \ell^\prime - v\,\Delta {t_\mathrm{r}}^\prime .$$

The light traveled speed $c$ for time $\Delta {t_\mathrm{r}}^\prime$. This time the light needed to move less than the length of the clock, because the front of the clock moved towards the light while it was in transit. Or

$$ c \, \Delta {t_\mathrm{r}}^\prime = \frac{\ell^\prime}{1+\frac{v}{c}} .$$

total time

The total distance for the light to travel out and back is $$ c\,\Delta t^\prime = c\,\Delta {t_\mathrm{o}}^\prime + c\,\Delta {t_\mathrm{r}}^\prime = \frac{\ell^\prime}{1-\frac{v}{c}} + \frac{\ell^\prime}{1+\frac{v}{c}} $$ $$ = \ell^\prime \left( \frac{1+\frac{v}{c}}{\left(1-\frac{v}{c}\right)\left(1+\frac{v}{c}\right)} + \frac{1-\frac{v}{c}}{\left(1-\frac{v}{c}\right)\left(1+\frac{v}{c}\right)} \right)$$ $$ = \frac{2\, \ell^\prime}{1-\left(\frac{v}{c}\right)^2} $$

or $$ c\,\Delta t^\prime = 2\, \gamma^2\, \ell^\prime.$$

Putting together the length contraction and the two time results gives the expected $$\Delta t^\prime = \gamma\, \Delta t $$

First: An observer traveling with both a vertical and a horizontal clock must see them tick at the same rate --- otherwise he'd know he was moving.

Second: The traveling observer and a "stationary" observer must agree about how many times each clock ticks during the time it takes the traveler to go from (say) Mars to Jupiter, because they can both simply watch the clocks and count their ticks. Therefore, since the traveling observer says they both tick an equal number of times, so must the "stationary" observer.

Putting the first and second observations together, everyone agrees that the horizontal and vertical clocks tick at the same rate.

Now if you take the vertical clock away, there's no reason for the tick-rate of the horizontal clock to change. Thus the horizontal clock must tick at the same rate as the vertical, even if the vertical clock is not there.

So: Use the vertical clock to calculate the time dilation. Recognize that the same time dilation must apply to the horizontal clock, whether or not there's actually a vertical clock on board. Now (all of this from the viewpoint of the "stationary" observer) you know the horizontal clock's tick-rate. You also know how fast the clock is moving, and you know the speed of light, so you can figure out the length of the light-beam's round-trip journey, and therefore can figure out the length of the horizontal clock.