How to make bpy.app.debug a prop?
Dummy property to update bpy.app.debug via UI



Script below uses a dummy boolean property on the window manager, with an update method to set bpy.app.debug to same.  Button is prepended to the 3D view header.

import bpy
from bpy.props import BoolProperty

def toggle_debug(self, context):
    bpy.app.debug = self.toggle_debug
    print("bpy.app.debug = ", self.toggle_debug)
    return None

bpy.types.WindowManager.toggle_debug = \
        BoolProperty(update=toggle_debug)

# function display the button
def display_toggle(self, context):
    layout = self.layout
    wm = context.window_manager
    layout.prop(wm, "toggle_debug", text="DEBUG", toggle=True)

# prepend to 3d view header
bpy.types.VIEW3D_HT_header.prepend(display_toggle)


To add properties to, or display properties in the UI,  the object must be an ID type.  Below is a simple test in python console to see if an object is an instance of an ID type.

&gt;&gt;&gt; isinstance(C.window_manager, bpy.types.ID)
True

&gt;&gt;&gt; isinstance(bpy.app, bpy.types.ID)
False


see that bpy.app is not, hence the error trying to use layout.prop(bpy.app, "debug")  

Also the error in your posted image is because app was not defined, assumed you meant bpy.app.