If its anything like the D3 key/remote? The key/remote is charged while it's in the ignition. It takes about 15 hours driving to fully charge the internal battery. Once fully charged, the battery will last a good year or more.
However the battery is known to break loose from its solder joints, stopping it transmitting the lock/ unlock code. On the D3, this requires the key/remote to be carefully cut apart so a replacement battery can be fitted. The key/remote casing will need replacing and gluing together after a new battery is fitted.