Amount is used with non-countable nouns, and number with countable. This is the simple explanation for your first example.
The reason for using the plural amounts in your second example is that each of the atmospheric gases has its own "correct" amount. There is a correct amount for oxygen, another correct amount for nitrogen, and so on.
- For Teachers