How to Add "px" as Unit to a Number Input?
The output_size should be an IntProperty that is declared with a subtype set to "PIXEL".

bpy.props.IntProperty(subtype="PIXEL")




bl_info = {
    "name": "Subtype example",
    "author": "Robert Guetzkow",
    "version": (1, 0),
    "blender": (2, 80, 0),
    "location": "View3D &gt; Sidebar &gt; Example tab",
    "description": "Subtype example",
    "warning": "",
    "wiki_url": "",
    "category": "3D View"}

import bpy


class ExampleSettings(bpy.types.PropertyGroup):
    output_size: bpy.props.IntProperty(description="Some elaborate description", default=1024, subtype="PIXEL")


class EXAMPLE_PT_panel(bpy.types.Panel):
    bl_label = "Panel"
    bl_category = "Example tab"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

    def draw(self, context):
        layout = self.layout
        layout.prop(context.scene.example_settings, "output_size", text="Output size")


classes = (ExampleSettings, EXAMPLE_PT_panel)


def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.Scene.example_settings = bpy.props.PointerProperty(type=ExampleSettings)


def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)
    del bpy.types.Scene.example_settings

if __name__ == "__main__":
    register()