So I was reading about standing wave patterns in strings and pipes however I could not get an intuitive sense about how a harmonic was defined in each case. In the case of a string, the harmonics made some sense to me since for $ n = 1$ there is only half a wavelength between the two fixed ends and so on but when it comes to pipes it does not seem to be the case.
The harmonics are usually numbered consecutively from 1 upwards. This is the case on strings, pipes (open or closed) or any other instrument.
The number of the harmonic is not necessarily the same as $n$ in your diagrams, which is the number of times the fundamental (lowest frequency mode $n=1$) fits into the pipe or string. For half-open pipes only odd multiples of $n$ are possible. Usually $n=3, 5, 7$ etc are called the 2nd, 3rd, 4th, etc harmonics, because they are the 2nd, 3rd, 4th etc highest frequencies which are possible.
Beware : the fundamental can be labelled $f_0$ or $f_1$.
Overtones are the same as harmonics but they are usually numbered with 1st overtone being the next mode higher in frequency than the fundamental, which is now labelled $f_0$.
It can be very confusing because the same meanings are not used everywhere. You have to read the question carefully and look for clues about whether the number given is the multiple $n$ of the fundamental $f_0$ or $f_1$, or the sequential order of frequencies, and whether the fundamental frequency is being labelled $0$ or $1$.