That is not a problem with the remote app to but with Microsoft's RDP OR the app you set up. When the app is closed, the season should move to a disconnected state by default. You can configure this via gpo to close shortly after disconnect.
If it is staying active, it is a problem with the specific app. You can confirm this but using a simple app like notepad which when closed will put the remote app session into a disconnected state.