Depends on the mouse you get. Some have a rechargable battery and you put the mouse into a cradle when you are not using the PC wherein it recharges.
Don't know about the procdure for the keyboard.
Most work on radio waves so there is no need for a direct line between the peripheral and the receiver. As for distance, I would have thought that upto 3 or 4 metres should be a minumum.
An optical mouse is certainly worth getting.