I made a hybrid app (game) which contains many html files. And when I play and click on this button
my app turns to previous page. Now should I set this button to turn my app off (and if yes how?) or maybe you have a better idea?
Take a look at https://cordova.apache.org/docs/en/latest/cordova/events/events.html#backbutton, documentation for tapping Back button and triggering the event.
May I suggest you just disable the back button action - do not close the app, do not close back. To go back or turn off the app, you should have an action on your screen, and the confirmation prompt.