It is completely safe to leave your Pencil docked with your iPad for extended period - in fact, this is recommended…
A second generation Apple Pencil should be kept docked with the iPad when not in active use - as this ensures that the tiny internal battery is kept optimally charged when not in use. Charging only occur when the battery requires charge from the iPad, optimal charge being entirely automatic.
Keeping the Pencil separated from the iPad when unused risks allowing its battery to discharge; if allowed to remain in this state, the battery will suffer irreparable damage. When the battery fails, the only remedy is to replace the entire Pencil; the battery is not a serviceable item.
An otherwise healthy Apple Pencil will suffer no negative consequences from being docked with its host iPad for extended periods.
Charge your Apple Pencil and check the battery - Apple Support