I think that your attempt at "understanding how the pitch affects the note" needs an answer with a deeper root than has been given. This is slightly mathematical, but rather necessary.
First, let's establish common simplified terminology:
frequency is a physical characteristic of the sound and it is absolute (does not depend on the instrument, tuning system etc.). Example: 100Hz.
pitch is the designation (name) given to a frequency. This is just a helpful convention and there is no physical measurement for a pitch. Example: C0.
note is a combination of a pitch and a duration. In Western musical notation, it is the basic representation of an instruction to produce sound. When written on a staff, it has to be combined with a clef for it to have a well-defined pitch. Example: 1/4 (quarter) D0.
Your question is about frequencies and pitches. There are 2 parts which are needed to address this relation.
1. Tuning System
In order to determine how the relate to each other, we need to introduce something called a
tuning system. A tuning system is a (bidirectional) mapping between the relation of frequencies and pitches. That is, it tells you when changing a frequency how the pitch changes.
Following are a couple of examples. I will use roman numerals (instead of A, B, ..., G) to symbolize pitches so to avoid a confusion which will be addressed in the 2nd part.
Note that because of
octave equivalence, it is standard for tuning systems to establish that when multiplying/dividing the frequency by 2, the change pitch goes up/down an octave.
Pythagorean tuning: When multiplying/diving the frequency by 3/2, the pitch goes up/down a fifth. Example:
I V IX
1 3/2 9/4 ...
When combined with the "blanket rule" of octaves, we can find the full frequency relation to pitch relation: by dividing the frequency ratio of IX by 2 we get the frequency for II (9/8). We can continue to multiply by 3/2 and then divide by 2n (this is called
folding) to find the rest of the relations. Here is a major scale:
I II III IV V VI VII VIII | IX X
1 9/8 81/64 4/3 3/2 27/16 243/128 2 | 9/4 81/32 ...
(For example, X is a fifth from VI and an octave from III.)
Equal temperament 12: When multiplying/diving the frequency by 12√2 (21/12), the pitch goes up/down a minor second (same as saying: divide the octave into 12 equal parts). Here is a major scale:
I II III IV V VI VII VIII | IX X
1 22⁄12 24⁄12 25⁄12 27⁄12 29⁄12 211⁄12 2 | 214⁄12 216⁄12 ...
Equal temperament n will divide an octave into n equal parts with a frequency multiplication factor of 21/n.
This should be (probably more than) enough to understand what a tuning system is.
2. Concert Pitch
Up to now we didn't mention pitch names, we just showed how a pitch changes with the change in frequency. In order to have a 1-to-1 mapping from frequencies to pitches, and not only from their relations, we need to establish a base point.1 This is an arbitrary choice - it is not a part of the tuning system (and is not given by some mathematical restriction).
The historical arbitrary decision was to map a pitch named A4 to various frequencies (though some tunings use C4 instead).
1Only if it helps, you can think about the linear function
a is the tuning system and
b is the base note.
With the choice of a base point, we can have a full mapping of frequencies to pitches. For Pythagorean tuning with A4=440Hz, A4 minor scale is (approx. Hz):
A4 B4 C5 D5 E5 F5 G5 A5
440 495 521 587 660 695 782 880
For ET12 with A4=440Hz, A4 minor scale is:
A4 B4 C5 D5 E5 F5 G5 A5
440 494 523 587 659 699 784 880
(Not too bad for a practical ET tuning!)
Here are your revised questions:
If flute A is pitched to A4=440Hz and flute B is pitched to A4=335Hz, and they both play the note C5, would they be playing the same pitch?
On each flute they would be playing the same pitch.
For example, in ET12, flute B will sound C5=335*23/12=398Hz, and flute A will sound C5=440*23/12=523Hz. They are both C5 on each of the flutes (same fingering, same place of note on the staff...).
Would the C5 on flute A be also a C5 on flute B?
No, they would not be the same pitch relative to each other.
For example, in ET12, C5 on flute B sounds like something between a G4 and a G#4 on flute A, about a fifth difference. This situation is reminiscent of that of
transposing instruments, where playing a pitch sounds a different one (when they both use the same concert pitch). For example, Bb and Eb saxophones and clarinets - playing a C on a Bb instruments is like playing a G on an Eb instruments. However, in our case, the frequency difference is the result of different concert pitch tunings and not of transposition.
(Thanks to guidot for pointing this out.)
Note that in another tuning system, C5 on flute B could match a different note than G-G#4, so the "effective transposition" amount varies by tuning systems. Thus, you can't ask "what would a pitch on flute A/B would sound like on flute B/A?" by giving only the concert pitch (though ET12 is assumed today).
Does the pitch only make the note a high or low note?
The pitch is the "height" of the note.
For example, when I play a C note in the lower and higher octave, are they both still a C note, one just higher than the other?
No, the confusion is purely due to a naming convention for pitches.
When dealing with octaves, it's useful to adopt a
pitch notation (like Scientific or Helmholtz). A C above the discussed C5 is a C6, and the one below is a C4. They are different pitches (because they are mapped by different frequencies on the same instrument2), they just use the same letter in this pitch notation to signify that they are octaves. In my tuning systems examples above, I used roman numerals where the octave does not reuse the symbol, so there is no confusion there and the answer is obvious.
2Different pitches can be mapped by the same frequency on different instruments. On a bass clarinet, a C5 will sound (have the same frequency) like a C4 on a regular clarinet.