The USB dongle that comes with the wireless key / mouse is often directional. It doesn't work equally well in all directions. You need to position the dongle in such a way that the dongle will point at you in the direction of maximum range.
To determine that direction, find a USB port where the slit of the port is oriented in the horizontal direction. Plug the dongle in it, so that the dongle is jutting out also in a horizontal direction along its axis. The side of the dongle now facing up is often the direction where the range is maximal. That's usually the side where you're holding your thumb when you plug the dongle into the port. It's also often the side where the company logo is printed.
E.g., for this dongle, it's the side with the name of the company and the Bluetooth logo:
What you need now is a short USB cable. Plug the dongle into the cable, and the cable into the computer. Now rotate the dongle until it's facing you with the side where the range is maximal. Glue it in place somehow. Now enjoy the better range.
If that side doesn't work well for your dongle, find a position that improves the range.
Also, make sure there are as few objects as possible between keyboard and dongle. E.g., if your computer is across the room from you, plug the dongle (via the short cable) into the front panel of the PC case. Or, if you only have USB ports on the back of the PC, bring the dongle to the front with a cable. Then rotate the dongle to find the best range, and glue it in place.
The improvements with this simple technique can sometimes be dramatic, even with cheap keyboard/mouse combos (within reason).
P.S.: In some cases, also the keyboard can be a little directional. It is sometimes the case that the keyboard has somewhat better range in a direction pointing down. If the PC is sitting under your desk, that's perfect. But if it's sitting across the room, in front of you, next to the TV screen, it's sometimes beneficial to tilt the keyboard back a little, so its bottom is slightly angled forward. Anyway, this is less important than positioning the dongle - so do that first, that's where the biggest gains are.
In general (not always, but as a rule of thumb), the wireless peripherals assume the PC is sitting under your desk, so that's the direction where they try to optimize things.
EDIT: When all else fails, just get a more expensive keyboard. Those tend to have better range.