Does pinMode access the physical pin number or the port pin?

Sorry, I'm a little confused because I'm trying to find the memory location of the BuildIN LED, which the website says the LED pin is 13. But the physical pin 13 is free. So I'm a little confused.

Use LED_BUILTIN as PIN number

Pin 13 usually indeed, which is both connected to the led but can serve other purposes

If you really want to see what it does, source code is available

void pinMode(uint8_t pin, uint8_t mode)
{
	uint8_t bit = digitalPinToBitMask(pin);
	uint8_t port = digitalPinToPort(pin);
	volatile uint8_t *reg, *out;

	if (port == NOT_A_PIN) return;

	// JWS: can I let the optimizer do this?
	reg = portModeRegister(port);
	out = portOutputRegister(port);

	if (mode == INPUT) { 
		uint8_t oldSREG = SREG;
                cli();
		*reg &= ~bit;
		*out &= ~bit;
		SREG = oldSREG;
	} else if (mode == INPUT_PULLUP) {
		uint8_t oldSREG = SREG;
                cli();
		*reg &= ~bit;
		*out |= bit;
		SREG = oldSREG;
	} else {
		uint8_t oldSREG = SREG;
                cli();
		*reg |= bit;
		SREG = oldSREG;
	}
}

All of the Arduino functions available in the IDE use the pin numbers as printed on the board. They do not use the physical pin numbers of the chip on the board. The mapping between the two is done as part of the compilation process based on the board selected in the IDE.

Pin "numbers" A0, A1 etc can be used for the analogue in pins whether used as analogue or digital pins.

UKHeliBob:
All of the Arduino functions available in the IDE use the pin numbers as printed on the board. They do not use the physical pin numbers of the chip on the board. The mapping between the two is done as part of the compilation process based on the board selected in the IDE.

Pin "numbers" A0, A1 etc can be used for the analogue in pins whether used as analogue or digital pins.

I'm still unsure which pin you are talking about. If you look up Arduino Mega 2560 pinout. You will see an image of the board. Are the pins you are talking about the ones that are physically printed in white paint on the board? So pin 13, then one I asked about, is PK5? I believe this is what you mean, but I'm unsure still. Thanks

Are the pins you are talking about the ones that are physically printed in white paint on the board?

Yes

I thought that

All of the Arduino functions available in the IDE use the pin numbers as printed on the board.

was clear enough.

so what you mean with physical in "physical pin 13" is the one on the ATmega2560 chip, right?

you can find detailed schema on what goes where on the internet but you usually don't need to worry about those