If you're near the charger, then leave it plugged in......if not, then use it on battery for as long as you need...though try not to let it drain to 0% too often.
If this is a laptop which is used as a desktop 99% of the time, then feel free to leave it plugged in 24/7, but try to use it on battery and run it down to say 20-30% once every month or so.
Honestly, this question has been asked and answered so many times on here, and you'll find many different views on the subject, but the bottom line tends to be......just use the machine as you need to, and don't obsess about battery health. 🙂