If you have exhausted the battery it could well take longer. After the two hour period it should run for about a month anyway so you could take out the charger after 2 hours.
Apple has designed these peripherals to only accept a charge when it's needed. When it doesn't need the power, it simply will not use it. However, it's a good practice to periodically, every month or so, unplug the keyboard and let it run on its battery until it gets very low (below 10%) or stops working.
Does Magic Keyboard Need to Charge? Yes, but not often. When your Magic Keyboard arrives, it should come with a certain amount of charged battery power already. Its internal battery can power your keyboard for about a month or more between charges depending on how frequently you use it.
Charging via a Magic Keyboard gives you 22 watts of charge power versus the tablet's native USB-C port which draws approximately 26 watts of power when charging the device. There are two ways to comment this. Firstly, you could whine about slower charge speed when using the Magic Keyboard.
It takes only a few steps to check a Magic Keyboard's battery life on a PC.
When you connect your Apple Magic Keyboard, Magic Mouse 2, or Magic Trackpad 2 to your Mac, it automatically charges. Connect one end of a Lightning to USB Cable to your Magic Keyboard, Magic Mouse 2, or Magic Trackpad 2 and the other end to the USB port on your Mac.
The Lightning cable side goes into the keyboard. Plug the USB-C part of the cable to your PC or Mac. You can also plug it into a USB hub or other device with USB functionality to charge it. Your Magic Keyboard will now automatically charge while it's plugged in.
How Do I Check the Battery on My Magic Keyboard?
When you connect your Apple Magic KeyboardApple Magic KeyboardMagic Keyboard delivers a remarkably comfortable and precise typing experience. It's also wireless and rechargeable, with an incredibly long-lasting internal battery that will power your keyboard for about a month or more between charges. ¹ It pairs automatically with your Mac, so you can get to work right away., Magic Mouse 2, or Magic Trackpad 2 to your Mac, it automatically charges. Connect one end of a Lightning to USB Cable to your Magic Keyboard, Magic Mouse 2, or Magic Trackpad 2 and the other end to the USB port on your Mac.
How often do I have to charge them? What's the battery life like? Apple says the new Magic Keyboard, Magic Mouse 2, and Magic Trackpad 2 should last you about a month or more on a single charge.
Use the bundled cable to charge the Magic Keyboard. Check the battery life remaining on your Mac or PC by checking your Bluetooth devices. The Magic Keyboard should last about a month between charges.
Check the Battery Life on a Mac
The sole purpose of the USB-C port is to allow you to power the iPad Pro while you're using it in a way that's both unobtrusive (the cable attaches at the rear corner of the keyboard, instead of hanging off the side of the iPad Pro), and leaves your main USB-C port free for other accessories.
With the Magic Keyboard, you can plug your charger into the USB-C barrel, and use the iPad's port to be used to connect peripherals like SD Card dongles, and more. The magic of this charging method is that the Magic Keyboard uses the Smart Connector pins to provide passthrough charging.