The Height is simply Alt2 - Alt1. The Height units will be the same unit type as the input Altitude values. For example if Altitude2 is 10 meters, and Altitude1 is 2 meters, then Height is 8 meters. If your Altitudes are in different unit types you will need to convert them to be the same unit type prior to calculating the Height.
The Altitude values given by a GPS will typically be referenced to Mean Sea Level, and understood to represent the Height "Above Mean Sea Level" or "AMSL". Note: In low lying areas you may see a negative altitude, so be sure to account for that in your code.
The GPS should give an indication whether the Altitude is being expressed in Meters or Feet, and should also typically give the user the option to specify their desired units.
Note: In some disciplines you will see heights expressed in AGL ("Above Ground Level"), or even both AGL and AMSL. For example, a given building roof may be 50ft AGL, and 1050ft AMSL; indicating that the ground the building sits on is at 1000ft AMSL.
Note2: Height and Vertical Distance are the same thing. There is a drawing in the answers which incorrectly shows the Vertical Distance as a sloped line between two points, however that sloped line is actually the "Slope Distance". "Vertical Distance" will always be the difference in height when considered from the center of the Earth. "Horizontal Distance" will be the distance between two locations (i.e. discrete coordinates) at a common elevation. "Slope Distance" will be the distance between those two locations at their respective elevations.