there are PCIe riser cables that you can imagine as an extension cord for a PCIe slot. they're popular in some thin server chassis or in miniITX builds where the form factor dictates the GPU must be in a certain orientation to fit.
there's also the method of external GPUs via Thunderbolt (which carries PCIe) that is more practical for putting a GPU in an entirely separate enclosure