Takeoff distance is always measured as horizontal distance.
Under 14 CFR Part 23, which apply to aircraft seating 19 passengers or less and a maximum takeoff weight of 19,000 lb or less, the pre-Amdt 64 specifications are:
For multi-engine jets of 6,000 lb or more, or commuter aircraft, 23.59 applies. Takeoff distance is measured as the horizontal distance between start of ground roll to where the aircraft attains 35 ft off the ground.
For others, 23.53 applies. Takeoff distance is measured as the horizontal distance between start of ground roll to where the aircraft attains 50 ft off the ground.
Note that a lot more nuance is involved since the greater of one-engine-inoperative distance and that with 115 percent of all-engine-operating distance goes into the actual performance number.
For Part 25 aircraft (transport category), there is a further distinction between dry and wet runway (25.113):
On a dry runway, it is measured to 35 ft.
On a wet runway, it is measured to 15 ft.
This information is harmonized with other regulatory agencies, such as EASA and TCCA.