Pitch is about the periodicity of the signal. It's true that it's based on psychoacoustics, but it is very accurate to say we are detecting the pseudo-periodicities of the signal when we hear a pitch.
The spectrum is the breakdown of the audio signal into a sum of sines and cosines of various frequencies. As David pointed out, usually when people talk about "Frequency" in a musical context, they are referring to the frequency of these sine waves that you broke the signal into. So the spectrum is looking at which of these sine components are large, and what frequencies they are at. The spectrum broadly represents the "high frequency" you hear in a high hat, and the "low frequency" you hear in the thud of a rock hitting the ground. Strictly speaking, neither of these sounds are periodic, nor do you perceive a pitch, but what you hear is the relative magnitudes of the high frequency and the low frequency parts of the spectrum
The Fourier Transform (or DFT/FFT) is the mathematical algorithm by which you break down your audio signal into the sums of sines and cosines. So by looking at the magnitude of these sines and cosines that you get out of the FFT, you get the Spectrum. A naive way of guessing the pitch is by looking directly at the spectrum of a short piece of audio, and assume that the biggest sine component of your signal corresponds to its fundamental periodicity.
I wrote up a very long answer to another post that I think will answer your questions of how to extract pitch: https://stackoverflow.com/a/7211695/94102 I'd strongly suggest reading it. It will give you the tools and understanding you need to make a high quality tuner.