If you install an APK over an older version of the same app, your data will be preserved (including save games). You’ll see the installer on launch say “Upgrading game data” in this case.
If you uninstall an app, your saves will be deleted with it.
The one exception to this rule is migrating from the Google Play version to the new APKs from Jenkins. Since they have different app IDs under the hood, you can have them both installed at the same time, they’re completely independent of each other. The rules above apply for both apps.
You can manually copy save games from the Google Play version to the new version, but I’d recommend against it as a lot of content has changed in a year or two of experimental updates, so it may work but will break some things in your inventory, may cause map oddities etc.