Hey there,
iPhone automatically stops charging when the battery is fully charged, so it's safe to keep your iPhone connected to a charger overnight. Charging resumes automatically if your battery level drops below 95 percent.
When possible, unplug your iPhone after it has fully charged. By default, your iPhone uses Optimized Battery Charging. To improve your battery's lifespan, Optimized Battery Charging reduces the time that your iPhone spends fully charged. It fully charges your iPhone just in time for you to use it.
A battery warms up as it charges, which can reduce its lifespan. To reduce the effect of heat and prevent overheating, iPhone gradually reduces the charging current as the battery approaches full charge.
Learn more about About Charge Limit and Optimized Battery Charging on iPhone
All The Best!