I think what you want will be called a barometer. It is what drones use to measure altitude. They are not super expensive, here is one for $6.70. You will have to be able to make a board to interface with an Arduino or something similar and be able to code it. Sparkfun may have a breakout. There are a number of ten-degrees of freedom (10DOF) motion sensors that incorporate a barometer for altitude measurement.
I will look into this! Thanks
You may be able to do this using the GPS on your phone with an app like Strava. I think the Z direction accuracy of GPS is not as good as the XY accuracy, but it might be good enough for what you want.
Marking your kite or balloon line is a very good way to do this. It is a bit of a chore to do it, but maybe easier than building a data logger or flying your phone. If the balloon line is vertical, you can always know the approximate altitude. Kites fly at different angles, but when your kite line is at 45°, the altitude of the kite is the line length multiplied by 0.7. The result can be adjusted if your kite (or balloon) is flying higher or lower than 45°. This might be good enough for your purpose.
Jack's solutions can provide very precise results after the flight. Barometric pressure is easy to measure and gives very good altitude estimates. A data logger to collect good altitude data every 10 seconds during the flight can be made for less than $10.
SD card module..........$1.00
Total...............................$8.25 (eBay prices including shipping)
Thanks Chris that's really helpful!