About 5 miles. There's two direct buses, Lothian 100 and 35. The 100 is quicker but more expensive (£3.50?) where the 35 costs £1.30. There's taxis and hire cars available at the Airport.
Edinburgh airport lies around 8 miles to the west of the city centre. There is a very frequent shuttle bus that goes from the airport straight into the centre of town that takes about 25 minutes.