Maxwell's equations have certain stationary states. We can obtain these so called modes and each classical waveform can be built as a linear combination of these modes.
In process called second quantization, we (hand wavingly) put particles into these modes. These particles are photons. Each mode can have 0, 1, 2 photons.
But there is more: we know from the uncertainity principle that no dynamic degrees of freedom can be absolutely confined, since that would imply infinite momentum. That holds for the coefficient of this electromagnetic mode as well, and hence there is always vacuum fluctuations of the electromagnetic field.
In other words, each mode can be represented as a quantum oscillator. (One derives an equation of motion for a mode, and realizes that some quantities behave like momentum and some like position). Quantum 101 tells that the modes of a quantum oscillator are quantized.
Now, we can have these modes in weird shaped cavity and hence we can have very structured modes with indefinte momentum. However, usually photons are measured in far field of the sample such that they have definite momentum and energy.
So, photon does not oscillate to any direction. Photon is an "occupation" of an electromagnetic mode which oscillates.
One more analogy to help to think about this: One could take a vibrating string and solve it's fundamental mode (say 440Hz). If this would be quantized, one can nerver find the string at rest due to uncertainity principle. Further, we will find that the string can only have quantized amount of energy. In other words, the magnitude of the vibrations is quantized. In other words, we can count how many (integer) energy quanta there are in the string. Let's all this quanta a vibron. Now, that is essentially the same thing to electromagnetism and phonons save Lorentz invariance, special relativity on masslesd particle, commutation relations of spin 1-particles, and some other compex stuff out of scope.