Firstly, Jorg is right but pedantic that compilation and interpretation isn't a property of the language unless it's explicitly specified that way; but nonetheless most languages have a canonical or reference implementation that is either compiled or interpreted, and some languages have features that are difficult to compile unless you ship a copy of the compiler with the runtime (C doesn't have "eval", for example).
Perhaps a more useful way to look at it parse time. For the "magic number" case, the number is encountered directly by the parser and treated as a literal. Whereas the named constant will usually be treated as either a symbol (that is, it's treated as an immutable variable), or a macro (something that is expanded at parse time and converted into a literal).
From that we can make a couple of observations from examples. Python has no true "named constant": it just has variables which by convention the programmer does not change. Original K&R C has no immutable variables either: it has macro expansions which are interpolated into the text of the program before parsing. ("const" was added in C90, but by then the style of the language was already set in the minds of programmers and a lot of old code)
There is an additional wrinkle if you consider that C has three phases, "preprocess", "compile", and "link". There can be variables which are defined as "const" but whose value is not known at compile time, only link time. https://stackoverflow.com/questions/2151831/non-integral-constants/
Certain other languages have pitfalls in which "constants" can be modified, e.g. FORTRAN https://www.ibiblio.org/pub/languages/fortran/ch1-8.html#01