The electromagnetic spectrum

It is useful to write time-harmonic wave solutions to the Maxwell Equations because we know from Fourier analysis that any arbitrary function can be written in terms of a sum of (or integral over) harmonic functions.  Physically, the interaction between an electromagnetic wave and matter generally depends on the frequency of that wave.  Therefore, we tend to classify electromagnetic waves in terms of their frequency.  The frequency spectrum of electromagnetic waves ranges from zero frequency to infinity and is referred to as the electromagnetic spectrum.  Wikipedia has an excellent page on the topic, which I refer you to here:

https://en.wikipedia.org/wiki/Electromagnetic_spectrum

Since wavelength is related to frequency, we can choose to classify harmonic electromagnetic waves in terms of their wavelength, which is what we typically do in optics.  This is slightly problematic, since we know that the wavelength of an electromagnetic wave changes as it passes through a material.  By convention, when we quote the wavelength of an electromagnetic wave, we are referring to its vacuum wavelength to avoid ambiguity.  Therefore, if I tell you that $latex 500 nm$ light is passing through water, what I mean is that light whose wavelength is $latex 500 nm$ in vacuum ($latex \lambda_0 = 500 nm$) is passing through water.  The actual wavelength of the light wave in the water will be less than $latex 500 nm$ as $latex \lambda = \lambda_0 / n$.

The visible spectrum is a subset of the electromagnetic spectrum consisting of electromagnetic waves that can be detected by the human eye.  The human eye can detect electromagnetic waves whose wavelengths lie in the range $latex 380 – 750 nm$.  (Can you calculate the frequencies of these waves?)  Our eyes detect the wavelength of an electromagnetic wave if it lies in that range, and our brains interpret that data as color.  Roughly speaking, your brain interprets $latex 400 nm$ light as violet in color, $latex 500 nm$ light as green in color, $latex 600 nm$ light as orange in color, and $latex 700 nm$ light as red in color.    The reason your eyes detect this range of wavelengths is that it corresponds to the peak of the blackbody spectrum emitted by our sun, so that it was evolutionarily advantageous to have this ability.