It's similar to on PC, where it depends on how files were stored by the app and how well they made their uninstall process.
Generally speaking, any data stored in the app specific storage (normally hidden from Android file browsers) will be cleared on uninstall, and any folders in the user-accessible area of storage will stay.
If you're concerned, you can run SD Maid 2 and turn on its uninstall watcher functionality so it can scan for any leftovers and clear them. That said, it's been pretty rare that I've ever seen it detect anything to remove after an uninstall.