The first question is: How much RAM can the hardware support? For example, if there are n bits transferred between CPU and RAM on every access, and the CPU has k address lines, then the CPU can access $2^k·n$ bits, or $2^k·n/8$ bytes.
However, the CPU must address things other than RAM, for example video memory, memory-mapped IO, ROM, and so on. So you need to add up these things to get the maximum usable amount of RAM. And it depends on both the CPU and memory hardware how much is actually usable. For example, if the address lines are enough for 64GB, and other hardware requires 2GB addressable space, then depending on the hardware, only 32GB, or 48GB, or 56GB RAM might be usable, but most likely not 62GB.
The next level is how much RAM the firmware of the computer can recognise. The computer doesn't know how much RAM there is when it is turned on, it must recognise that RAM. That's usually done by software firmly built into the computer. And that software might only be able to recognise say 16GB of RAM. (This often happens with old computers, where no memory chips for more than 16GB were available when the computer was sold, and newer, bigger memory chips cannot be recognised).
So that is all before the operating system comes into play. Usually the OS doesn't have any limitations itself. Sure, it requires more memory for page tables etc. if there is more RAM, but then it has more RAM available to hold page tables because it has more RAM. There are cases where the maker of the OS has a "home version" and a "professional version" of the OS, and the "home version" of the OS may be artifically restricted.
Or the OS may have decided to use quite arbitrarily only a small number of bits for the index of a RAM page in some data structure, for example. If the OS uses only 24 bits to store the index of a RAM page, and a RAM page is 4KB, then that OS can only handle 64 GB of RAM. Which is quite possible for an OS written twenty years ago, when someone might have thought "nobody will ever have more than 64GB of RAM". (I remember a computer that could hold up to 1.5GB of RAM, and the RAM was four times more expensive than the rest of the computer).