On Linux there are two big desktop environments, (GUIs, desktops etc. on macOS/Windows there's no choice, only one).
These environments are called GNOME and KDE.
The Librem5 will by default ship with a GNOME-based environment, customized for phones.
On GNOME, you program GUI applications using a widget library called GTK, now at version 3. Think of this akin to Cocoa/WinForms.
There are two main programming languages to develop GTK apps, C and Vala, (Vala's akin to C#), however there are bindings to many other languages including Python and JavaScript, so unlike on macOS/Windows, you're not as restricted when it comes to your development environment.
GNOME has an IDE for building applications intended to run on it called Builder, akin to Xcode/Visual Studio. You'd normally use this IDE to develop your app. You'd want to select the Flatpak project type. Flatpak is a way to ship apps that will be supported on the phone. There's a library called libhandy you can use to make sure your app fits nicely on the phone ie is responsive.
Now because this phone is GNU/Linux and is open, you're not restricted to what I laid out above, that's just the most sanctioned way to develop apps.
The phone will be able to run any Linux binary that can be compiled for ARM, so as long as the compiler you're using can do that you can use pretty much any language, framework etc. You can even draw your graphics via OpenGL or ship a command line app or anything else you may wish.
You're not as restricted, but also not as guided as on iOS/Android.
iOS and Android basically provide a sandbox for Apps (where the user can set permissions). Does Librem5 do the same, or does it install programs like, say, apt-get would do, that is, without sandbox per application?
Flatpak is what provides you with a way to package applications with all of its dependencies and also provides a per-application sandbox. You'd normally install an application via the Flatpak app store that is going to be on the phone.
apt would remain an option for those who want it, but for regular users they'd install the Flatpaks via an app store like interface.
That's not super helpful if you've never built anything for Linux before.