Go to your Settings, then Device Maintenance, then tap the Battery section, tap the menu button and select 'Advanced Settings', tap the App power monitor option and turn it off altogether; that will stop the OS from putting running apps to sleep automatically.
If you still want the system to stop apps but just want to get rid of the notification, then in the same section select Notification Settings. There turn off the one for 'Unused apps' (or any of the other two options if they also bother you).