The easiest way to understand how altitude affects a cup of coffee is this: The higher the altitude the harder the tree has to work to produce fruit. This lengthens the time between flowering and the ripening of the coffee cherries and it's this longer time that allows more complex flavours to develop.
As a general rule, as the altitude gets higher (above 1200 masl) you'll get more sweetness, more floral notes, and more complexity. Ethiopia & Costa Rica are great examples of countries where coffee is mostly grown at these higher altitudes, but as said, it's a general rule. The key takeaway is that coffee will get more interesting the harder the tree has to work to produce fruit - being further from the equator, grown in shade are two other ways to make the coffee work harder.