Ideally, it depends on the glide ratio and airspeed of the airplane in question, to be able to make the runway in the event of engine failure.
Realistically, it depends on other practicalities, such as skill level of the pilot (particularly in the early learning stages).