By default in Gnome Alt+Tab switches windows on all workspaces. If you prefer many workspaces with few windows each, this behavior does not work well. Maybe you want to switch windows only on the active workspace.
When googling for the Alt Tab Workspace extension, it is the top result. The code on GitHub turns out that the following command does the trick:
gsettings set org.gnome.shell.window-switcher current-workspace-only true
gsettings set org.gnome.shell.app-switcher current-workspace-only trueCode language: CSS (css)
To erase it, go back to default settings:
dconf reset /org/gnome/shell/window-switcher/current-workspace-only
dconf reset /org/gnome/shell/app-switcher/current-workspace-onlyCode language: JavaScript (javascript)
Switching the Windows Only on the Current Workspace in GNOME Shell
Another fast and easy solution, without any installations/extensions, is to use Dconf Editor.
Dconf Editor is a tool for viewing and editing the internal settings of a GNOME application. In addition, it enables editing options that are not visible in the interfaces of some applications.
However, be aware that it’s a powerful tool that, if misused, can break some applications, so use it with that in mind.
1. Install dconf-editor (already installed on current Debian/Ubuntu distributions):
sudo apt install dconf-editor
2. Open dconf-editor (from the Dash or a Terminal)
3. Navigate to: org -> gnome -> shell -> app-switcher
4. Set current-workspace-only to On by toggling the switch.

That’s it. When switching between windows in GNOME, you will only see the windows that are in use on your current workspace.
Related: Restrict Alt+Tab to the Current Monitor in GNOME Shell
I hope this quick and short guide has been helpful to you.
