If you do need to turn the keyboard off, the right-hand end of the top tube part of the keyboard (acts as its riser in the back) is the on-off button. Press the button until you get the on-screen diconnect notice (or until the indicator light on the keyboard flashes a few times).
Initially I would turn off the keyboard and mouse overnight, and perhaps during the day when I was not going to be using the Mac for many hours. After a month I got tired of doing that, and started to leave them on.
I've had this machine about 3 months now, and the battery level for the keyboard is still showing 100%. However, I've had to change the batteries in the mouse about a month ago, and it's now reporting 50%.
Even though I tend to do more mousing than keyboarding, this disparity in rate of consumption seems a bit much. I've been considering getting one of those non-contact recharger thingies - you put special batteries in the mouse, then place the mouse on top of a pad-like device when you're not using it and the batteries are 'magically' recharged.
*****
Apple suggests not turning the iMac off unless you are going to be away from it for several days.