If you install windows on a machine that already has ubuntu, it will overwrite the MBR (Master Boot Record).
This is a guide that will allow you to keep boot priority on ubuntu (EFI)
grub-install onto the device that you installed ubuntu on (don't specify partition e.g. /dev/nvme0n1)
sudo grub-install /dev/<device_with_ubuntu>