This article talks about gamepad installation and setup. The two stages of configuration are often driver installation, and device configuration. Many devices have support integrated into the kernel and will work as soon as they're plugged in. Others can be more difficult.
Given that the majority of devices have their necessary drivers built-in, the only thing most people might need to do is calibrate their controller afterwards. Many desktops have built-in configuration modules to select any connected gamepads and calibrate them. The process in the KDE Plasma desktop is documented here but the instructions are near-universally applicable.
Open Application Launcher > Search > Game Controller
Open Application Launcher > System Settings > Input Devices > Game Controller
- Select your gamepad in the "Device" drop-down box
- Hit the "Calibrate" button in the bottom-left and follow the on-screen instructions
There are many useful games in the Debian repositories for verifying that your gamepad works as expected, but supertuxkart is especially recommended due to its fantastic gamepad support.
Xbox and PlayStation controllers
Xbox, Xbox 360, and Xbox One controllers, including many knock-offs, should work out-of-the-box with no issues. This includes both wired and wireless variants, whether by using official wireless receivers or through Bluetooth. This also applies for the DualShock 3 and DualShock 4 controllers commonly used by the PlayStation consoles.
Support for the Steam Controller is provided through the steam-devices package. By default, it works in "desktop mode" where it emulates mouse input. It will act as a proper controller only for games launched through Steam.
There's a project developing a user-mode driver for the Steam Controller that allows it to emulate an Xbox controller in any game without need for the proprietary Steam client. It is not officially supported in Debian however, and it will require extra configuration of its own: https://github.com/kozec/sc-controller
Nintendo Switch Pro Controller
While support is not integrated into Debian yet, Steam implements its own driver and it should theoretically be usable with Steam games only. An official kernel driver is in-progress.