Most probably, what you are referring to here is the equation
$$ f_{n} = \frac{n}{2 L} c = \frac{n}{2 L} \sqrt{\frac{T}{\mu}}, ~~~~~ n = 1, 2, \ldots $$
with $c$ being the speed of sound in the string, $L$ the total length of the string $T$ the tension of the string and $\mu$ its linear density. Number $n$ is just the harmonic index with $n = 1$ being the fundamental. Note that the speed of sound in the string in this linearised approach is given by $c = \sqrt{\frac{T}{\mu}}$.
When you tune the guitar string you alter its tension. By direct inspection of the equation above you'll see that the frequency of the fundamental (and all the harmonics since they are dependent on the fundamental) will change as $f \sim \sqrt{T}$.
More intuition about the resulting changes in speed along with the frequency can be built by inspecting the equation above and the fundamental wave equation that relates speed and frequency
$$c = \lambda f$$
with $\lambda$ being the wavelength. By changing the left hand side of this equation the right hand side must also change for the equality to hold. From the equation above you'll notice that the two quantities connected are frequency and speed of sound, so by changing the speed of sound you effectively alter the frequency of the right hand side of the second equation, leaving the wavelength unchanged. This makes sense, since for a standing wave to exist there must be a specific relation between the wavelength and the length of the string.
The frequencies supported by a string are very specific and depend on the dimensions of the system (string) and the boundary conditions (how is the string attached at the ends). For the equation presented above, the boundary conditions are $x \left( 0 \right) = x \left( L \right) = 0$ which means that the sting is not allowed to move on its edges. If these conditions are changed the allowed wavelengths will be different, thus changing the allowed frequencies.
If we consider solutions of the wave equation for this system of the form (corrected after Gert's comment)
$$ u \left( x, t \right) = \sum_{n = 1}^{\infty} A_{n} \cos \left( \frac{n \pi c t}{L} \right) \sin \left( \frac{n \pi x}{L} \right) $$
use the boundary conditions presented above and combine with the second equation you end up with the solutions for the allowed frequencies of the form given by the first equation (you have to use $c = \sqrt{\frac{T}{\mu}}$ to epxress the speed of sound). Please note that this is a standing wave solution derived from two waves traveling in opposite directions.
As you can, see, there are only specific frequencies allowed in the system based on the boundary conditions and the dimensions of the system. You use the term resonance here, which is not exactly equal to the topic of the natural frequencies of a system. What we have touched upon here is the natural frequencies of the system, which will be excited when the system is free of external forces and left to vibrate freely.
On the contrary, a resonance frequency, which is defined as the frequency for which an infinitesimal change will decrease the excitation amplitude (whether this is of amplitude, velocity, acceleration, pressure or whatever other quantity) of the system, refers to forced oscillations with some "source" providing the energy to sustain the vibration. In this case, the frequency the system will oscillate is always the frequency of the source (for a linear system at least). If this frequency coincides with one of the natural frequencies of the system (most probably some small corrections have to be made but those given above are adequate for a first-stage approximation) then we can talk about "hitting" a resonance.
Just to make it clear, when the system oscillates freely, it will do so in the frequencies given by the first equation. When the system is excited it will oscillate with the frequency provided by the source. If the latter happens to coincide with one of the natural frequencies, the amplitude (or velocity, or acceleration) will be maximised.