Do you have any USB devices plugged into your Mac?
Or do you have a Thunderbolt dock which has USB devices plugged into your Dock?
These days most USB devices (external disks being the most common) are USB3 based devices.
You can experiment by disconnecting all external devices regardless of how they are plugged into your Mac, and see if your Bluetooth keyboard and mouse keep disconnecting.
USB-3 interference white paper from intel:
<https://www-ssl.intel.com/content/www/us/en/io/universal-serial-bus/usb3-frequency-interference-paper.html>
I will also ask if you have your WiFi router sitting right next to your Mac. A WiFi router (or WiFi access point) will have a strong 2.4GHz radio, and Bluetooth shares the 2.4GHz frequency band. Generally they do not interfere, but one basically sitting right next to the other might cause the WiFi transmitter to overwhelm the Low Power Bluetooth radios.
If none of the above applies, or you have unplugged things and your keyboard and mouse still disconnect, then try the following:
1) Reset the System Management Controller (SMC) on your Mac - Apple Support
https://support.apple.com/en-us/HT201295
2) How to reset NVRAM on your Mac - Apple Support
https://support.apple.com/en-us/HT204063
3) Boot into Safe mode and see if the keyboard and mouse behave
http://support.apple.com/kb/ht1564
This will not load any 3rd party additions, it will load some more conservative Apple drivers (may cause screen flicker), and it will clear some kernel caches (a cache is saved data in a form that can speed up a program, but is totally redundant to the original source, and thus can be safely cleared). Booting into Safe mode is just an experiment, but can frequently eliminate any 3rd party interference, or a cached item out-of-sync with the world. (Verify Safe mode via Applications -> Utilities -> System Information -> Software -> Boot Mode -> Safe vs Normal)