The window.onblur event will tell you when the app loses focus; window.onfocus will tell you when it has the focus again. (There also the visibilitychange event on window/document and their visibilityState property that you can use to know if the app is visible but without the focus, as when sharing the screen.)
Scenario 4 of the Clipboard app sample in the Windows SDK shows how to use blur and focus events to manage calling the clipboard's getContent method at appropriate times.
Note also that because the contentchanged event comes from a WinRT object, be sure to removeEventListener if you're not going to be listening to the event for the entire lifetime of the app. That is, if you might possibly call addEventListener for this event more than once, neglecting to remove the listener will cause a memory leak.