How far does an A320 travel horizontally while climbing to / descending from cruise altitude?
Of the main variables are the weight at brake release, and how high the cruise FL is. Luckily the manufacturers publish this data for flight planning (actual mileage will vary).

The climb distance you are looking for is the lower-left value in each box in the example below, which is applicable to the 320-family:



You can find it in the FCOM under Performance > Climb. A similar table exists for descents. Of course the values do not include the wind correction. For climbing other tables exist for the various deviations from ISA (lapse rate).



If you want to calculate it from scratch, then you need to have more data before you begin, I recommend these posts:


How to find total climbing time based on Rate of Climb?
Is there a formula to calculate ground distance traveled given rate of climb and true airspeed?
Is it possible to determine the approximate climb rate of an aircraft knowing its top speed, engine power and weight?
How can I calculate maximum rate of climb?