It all kinda depends on what your doing and/or talking about...
Think of them like this:
Mixing is when you take two components or things and put them together in some way (side-by-side, intertwined, ect.) This applies to most anything in life to.
In terms of audio, you could be taking about things from biggest to smallest.
For instance;
If you a DJ you could be talking about mixing two or more songs together, making (ironically), a mix.
If your a producer, you could be talking about mixing sounds (samples, vst's, effects, ect.) together to make a song.
And if your a sound artist, you could be talking about mixing frequencies of sounds together, thus to make a complete sound.
Mastering is very different, but it has some of the same rules...
Mastering isn't always improving something though, it could be to downsize it in some ways to (quality, size, amount of components, types of components, ect.)
An example of improving quality would be something like trying to removing clipping.
Clipping is when the stream of audio is not connected to the Apex (mid-line) of the stream in some way.
Start and End clipping (Image no.2) is when the audio stream is cut off at the start or the end of the stream before (or after) it reaches the Apex. To fix that I usually minimize the stream to a very small margin and add a fade in or out (depending on which side of the steam your on) to normalize it.
Mid clipping (Image no.3)is when the audio stream is cut off during the stream from the Apex or from the stream itself. To fix this you must align the incoming audio with the audio that has already played to connect the stream back to a constant flow. However, depending on the frequency of the sound and what the sound is based prominently on (bass, mid, treble, or noise) the connection may remove any clipping, but the sound may still jump from frequency to frequency.
Hope this helped,
DJ InTheDark