Yes, if you switch SIM cards in your phone, Whatsapp will continue to work as usual (linked to your old phone number). You’ll keep all the chats and groups that are already setup. As long as you don’t log out of your Whatsapp account (e.g. by resetting your phone or uninstalling Whatsapp) if should keep working indefinitely.

Don’t log out of your Whatsapp account

If you reset your phone or uninstall Whatsapp, you’ll loose access to your old account. To reinstate with your old account you’ll need to receive an SMS verification code on your old phone number, which could be difficult if you’re roaming overseas.