Ok basically as a general rule in classical writing the harmonic minor scale is used for harmony (i.e. the chord progression that accommpanies the melody) and the melodic minor scale is used for melody. I'll explain this below.
Firstly, A minor as a key has no sharps or flats. (The same as C major, A minor is the relative minor of C major. So the natural minor scale in A minor has no sharps of flats: A B C D E F G A
When composers were composing in minor keys they realised that while they were using the minor key's scale (if taken from the key signiture this is the natural minor scale) they would often approach the tonic/root by semitone. Thus raising or sharpening the leading note (seventh degree) by a semitone. This produces the harmonic minor scale : A B C D E F G# A
However, many composers found that when writing melodies, the augmented second (three semitones) between the sixth and seventh degree (in your a harmonic minor case between the F and the G#) was a melodically awkward leap. So composers started to sharpen/raise the sixth degree to make the scale sound nicer but still work in a minor context. This is whats known as the melodic minor scale: A B C D E F# G# A
However, it descends identically to the natural minor scale: A G F E D C B A.
This came about simply due to musical practice and what sounded right to the composers rather than from theory as such.
All of the above only really applies to classical music of course though. Just thought i'd explain it.
In rock guitar terms, the harmonic minor scale is used for an arabic/gyspy feeling and this is because of that awkward leap mentioned above. Yngwie Malmsteen milks the harmonic minor scale.
The natural minor is probably the most commonly used minor scale as in general and a good place to start.
I always find the melodic minor (especially in ascending form) a hard one to use because it sounds to me too much like the major scale with a flat third.
Hope i've helped. Sorry for getting too into it, i'm a bit keen for musical theory. :P