"Temperament" generally refers to the system used to assign a frequency value to each specific named pitch. An octave, or equivalent term, is defined in most musical systems as an interval of two pitches in which the higher pitch is exactly double the frequency of the lower pitch, or, equivalently, as the interval between the first harmonic (the fundamental) and the second harmonic (the harmonic with exactly half the wavelength of the first).
In the modern Western or European music system as of shortly before the Renaissance, the octave is subdivided into twelve notes or pitches, of which seven are lettered A through G (or in some European systems using "solfeggio" syllables popularized by The Sound Of Music as "Do, Re Mi". The remaining five tones of the scale are located in between lettered notes, and are indicated as "sharp" (a half step higher) or "flat" (a half step lower) than a lettered note. The "sharp" of one lettered note is usually the same pitch as the "flat" of the next higher lettered note, except in two cases, between B and C and between E and F, where only one half-step separated the two, and so "B-sharp" is the same note as C and "E-Sharp" is the same note as F.
Originally, the subdivision of notes between octaves was done linearly, based on mathematical principles such as those of Pythagoras which predicted notes such as the "perfect fourth" and "perfect fifth" that sounded pleasing because they represented subdivisions of an octave into wavelengths that were both integer fractions of the octave and summed to the octave itself. While this worked within the older "modal" system of early music theory, as the modern 12-tone system took shape allowing any note to be used as the "root" of a "key", this system of "just temperament" presented a problem; when tuned to a particular key, such as C, not all notes within that key were exactly twice or half the frequency of their own "octaves", because the system of octaves was based on an exponential scale, while the notes within it were distributed linearly. This caused pieces played in a key other than the one to which the instrument was tuned to sound incorrect and out of tune.
In the late Renaissance and early Baroque periods, this was solved by mathematicians who identified the problem (the difference between exponential and linear frequency curves) and developed a solution; the "equal temperament scale", described by a single exponential equation that would assign the notes within each octave a frequency that fell on the "best-fit" line between octaves. The net result was that every named pitch was exactly half or double the frequency of the higher or lower octave of the same named pitch. The problem, for some, was that this system didn't reproduce the exact partial harmonics heard in the just temperament system, so intervals like the fourth and fifth sounded slightly out of tune, and other intervals like the third sounded even more so. The equal-temperament system met with only limited success until Johann Sebastian Bach wrote a book of etudes, preludes and fugues for "The Well-Tempered Clavier", incorporating songs in each of the 24 named keys (A Major, A Minor, Bb Major/Minor, etc) that were now possible to be played one after the other on the same instrument in a single concert or recital. Bach's musical descendants in the Baroque and Classical periods, including Mozart and Haydn, studied this work closely and incorporated novel ideas such as key changes based on this system, solidifying equal temperament as the preferred tuning system of Western music. Nowadays, modern listening ears are accustomed to the equal-temperament system, and the slight dissonance produced by the equally-tempered third, fourth and fifth in mechanically-tuned instruments like the piano are considered normal. On instruments for which dynamic tuning is possible, such as the bowed-string family, the trombone, and the human voice, it's possible to tune these intervals perfectly on the spot, and this is often encouraged especially in choral groups to bring out the harmonics that these perfectly-tuned intervals produce.
The remaining variable in most Western music performance is the "tuning standard" or "reference frequency"; this frequency, typically a reference for the pitch "A4", determines the frequency of all other notes according to the equal temperament equation. The usual standard for most instruments is A-440, so A4 is exactly 440Hz, A3 is 220, A5 is 880, etc. However, performing groups are free to adopt any standard they choose (as long as all instruments are tuned to the same standard), and standards anywhere from A-438 to A-445 are relatively common. The standard is often altered at will based on an instrument that is difficult to tune, such as a pipe organ; climatic differences such as temperature and humidity can cause the instrument to vary naturally by a few Hz either way, and as retuning a large organ with thousands of pipes can take days or weeks, it's typically easier for an orchestra or chamber group playing with an organ to tune themselves to the organ's current A4 pitch. The organ tuner can then concentrate on simply keeping the instrument in tune with itself, requiring smaller changes to fewer pipes.