I started learning about pointers in C++ and I figured I should educate myself a bit on how memory works and is accessed. I read that when we say a processor is 64-bit, it has a 64-bit register and can access 2^64 address locations. I also read that it can fetch 64/8, so 8 bytes of data at a time, but the data bus is not the same thing as the register right? Do they need to be the same size or does that just happen to be the case usually? And is it the size of the register or the data bus size that determines what we refer to it as, such as 32/64-bit? Also is there a difference between register size and address size?
When you refer to a 64-bit or a 32-bit it doesn't need to imply any register width or bus width alone. You can multiplex a bus such that it reads 64 bits in two reads or four reads etc. A CPU design can be as creative as the engineer behind the logic blocks. A good example is the 8086 with a 20 bit address space and a 16 bit data bus. The software that you write in C++ wraps on top of many layers of compilation and hardware state machines such that this is abstracted away. In RISC design you'll find that registers width and ALU width are almost always the same width, but in CISC design this does not need to be the case so much.
Width of the processor will be defined by the width of the registers inside. The ALU will be able to process the registers directly. The data bus width and the address capacity seldom defines the processor bits.
PS: A 32 bit compiler and a 64 bit compiler gives different results on a 64 bit machine.