"Apparent magnitude" is a kind of brightness quantity. But as you guess, brightness depends on the distance between observer and a object. Apparent magnitude is just the brightness, when you observe it from the Earth with, or from space telescope from space. But be careful, its unit is not just the same with brightness(whose is energy/time). After Hipparchus, who was the first sky watcher to determine the locations of the stars, and he also labeled the brightest star as 1 magnitude, and the faintest with 6 magnitude.