The good news is that you can charge the controllers even while playing, and you can enjoy up to 20 hours of active gaming when the Joy-Con's batteries are fully powered up.
Check out the products mentioned in this article:
How to charge a Nintendo Switch's Joy-Con controllers
Connect the controllers to the console
You can achieve this by resting the console in its dock when you're not using it (as pictured above) or by connecting the Switch to power directly when you will be using its built-in screen for play (as pictured below).
When plugged in and not in use, the Joy-Con controllers will take about three hours and a half to fully charge, and this charge should last for about 20 hours of use.
If you connect the controllers to a Switch console that is not plugged into power, the Joy-Cons will be charged to about half power or until the Switch's battery runs low, whichever happens first.
Connect the controllers to a charging grip
If you want to play on a TV and charge your Joy-Con controllers at the same time, you need to buy a charging grip separately.
You can connect this controller grip to your AC power unit, and it will charge the Joy-Cons even as you use them on another display.