The answer @Monomeeth provided is good for those apps that have been developed to transfer documents between your iPhone and your computer. Some apps however do not expose data created through the app this way. E.g. game settings or game scores may sometimes only be synced via the developer's systems or not at all. Some other apps might offer an export function, only offer emailing certain data or share it in other ways. Other apps again might not offer any export at all.
Mind you I have a number of apps that will not work in iOS 11 and that has actually prevented me yet from upgrading until I can safely get my data off. For instance, I installed Apple's Cards app back when it came out in 2011. It once allowed you to order printed cards with your photos on them. I still kept it for sentimental reasons. Stored on the app are all the cards that I previously created and sent, but there's unfortunately no way to get them "out" in any way other than "screen shooting" the inside, outside and the envelope.
I also purchased the SnappyCam app back in 2013. The app allowed taking rapid bursts of photos before it became available in Apple's Camera app. The developer, John Papandriopoulos, was soon poached by Apple. Soon after that the SnappyCam app disappeared from the App Store, but the functionality wasn't there until the next iOS release. I kept the app because it was good. It allowed you to make GIFs and videos, among others. Now the time has come to delete it.
SnappyCam's data was never available through iTunes. While SnappyCam's photos can be accessed through iTunes, you won't have the app functionality of course, such as creating animated GIFs or videos sequences. In this case it's better to use the app one final time to save all the GIF renditions and video sequences of the photos in there, if you hadn't done that already.
So, while the iTunes option might get you some data, it probably won't get all of the data off your iPhone or iPad. Also, note that the File Sharing option is as of iTunes 12.7, I think. AFAIK, before that it was called Apps.