You don’t need to keep the app open for the app to function. All your previous encounters are saved on your Timeline.
However, people you cross paths with when your phone is off or on “Airplane mode” won’t appear on your Timeline. This rule also holds true when you pause happn for 8 hours.