To extend lifespan of lithium-ion battery, it is recommended to not fully charge it. Lithium-ion batteries are usually used in phones and laptops. Charging to 100% level stresses them.
There are multiple recommendations how to charge Li-Ion battery. Probably the most popular is so called
40-80 rule, according to which is recommended to keep the charge level close to 40% - 80%. Other popular battery charging rules are 20-80 and 20-90.
But manufacturers have their own recommendations, how to charge lithium-ion batteries:
Samsung recommends charge battery to less than 100%, optimally to 80% - 85%
HP recommends charge battery to 85% - 90%
Apple recommends charge battery to around 80%
Huawei recommends 30-70 rule
To stop charging at a certain charge level, you can use some of the battery charging apps.