I too have this problem with a brand new Dell XPS13 laptop and Dell KB7120W bluetooth keyboard. Mouse stays connected fine, but key board stay connected more than a couple hours. Paired the keyboard to my work laptop as a test. Still worked after a couple days. Oddly, its status would change from "Connected" to "Paired" if it was idle for a while, but it always worked when I used it (no lag) and the status returned to "Connected" in a few seconds.
Sure feels like my Dell is putting the keyboard into a deep sleep or something, that it can't wake up from. Some old posts talk about a power setting for the keyboard regarding sleep. But that must be for an older version of Windows, because the instructions on how to find them are no longer correct.
Dell site reports others with such problems, pretty sure including PDempe. They say to update drivers, but don't say which ones. Oddly, Windows said all my drivers were up to date, but Dell said they weren't and I updated from there. Didn't fix my problem, though.