PCIe connections operate with x number of "lanes." One lane provides roughly 900MB/s (that's MegaBYTES/second) after overhead. There's three main considerations with PCIe connectivity:
1) The slot size, physically speaking. An x16 slot is full length and can physically accept things with an x16 connector like a video card. You'll see x8 slots a lot on server motherboards but rarely on workstation boards. x4 slots are the same story. You will see x1 slots (the smallest of them all) frequently on workstation boards. Sometimes a motherboards will have an x16 slot (full size) BUT it will operate at x8 or even x4 bandwidth (more on this in point 3 below).
2) The capability of the device you're connecting, like your GPU. Unlike the mobo slots, the devices are straight up x16, x8, x4 x2 or x1, and this tells you both the physical size of their PCIe connector AND the bandwidth of the device. So an GPU for instance has an x16 connector and can utilize up to 16 lanes of PCIe 3.0 on the board totaling over 14GB/s of bandwidth. Likewise, most of your RAID cards out there have x8 connectors and can move data at a rate of roughly 7200MB/s IF they have a PCIe 3.0 connector. Many have PCIe 2.0 connectors which provide about 500MB/s per lane totaling about 4GB/s of bandwidth to the board. This is something that's important to consider with things like RAID cards since your RAID set will have X number of HDD/SSDs that can potentially read or write at a certain MB/s so you want to ensure your PCIe connection to the motherboard can move the data as fast or faster as to not bottleneck your data.
3) PCIe lanes available to your PCIe slots from the processor and motherboard. This varies very widely based on what CPU and chipset you have. The number of PCIe lanes available to each slot also changes on almost every board depending on what you've connected in other PCIe slots. Note that m.2 connectors also eat PCIe lanes if you install an NVMe SSD in them. Best place to determine this is from the motherboard's specs. It will tell you how many lanes are available to each of its slots and also how many lanes are taken away from a slot if you install something in another. Perfect example is on most mainstream boards (X170, X270, etc). If you install a GPU in the first PCIe x16 slot the GPU is provided 16 lanes of bandwidth. If you then install any other device in the 2nd PCIe x16 slot (another GPU, a RAID card, etc) then both PCIe slots split the 16 lanes and each slot provides 8 lanes to the devices. You've got to be careful with this resource sharing. While many motherboards have 3 x PCIe x16 slots, a few PCIe x1 slots and 1 or 2 m.2 connectors, you can only actually connect devices to maybe 3-4 of those. Its all in the motherboard manual.
Note that slots are backward compatible with older versions of PCIe. If you have a PCIe 3.0 slot you can install a device who's connector is PCIe 2.0. The device will just operate at PCIe 2.0 bandwidth (500MB/s per lane).
As far as physical connections go, to your original question, if you have a device that has a PCIe x4 connector then (per bullet 1 above) it can be installed in a PCIe x16, x8 or x4 slot.