Can not boot Windows on Legacy BIOS after installing Ubuntu on UEFI

The problem is that you've mixed your installation modes -- Windows in BIOS/CSM/legacy mode and Ubuntu in EFI/UEFI mode. GRUB can't switch between these two boot modes, so you'll need to either re-install one of your OSes so that they both use the same boot mode or find some other way to switch boot modes.

For re-installing, it's likely to be easier to re-install Ubuntu, but you'll need to be sure that the Ubuntu installer is booting in BIOS mode. You can usually select the boot mode of the installer by picking the correct option from your computer's built-in boot manager. There are usually two options for external media, one of which includes the string "EFI" or "UEFI" and the other doesn't. Pick the one that lacks the "EFI"/"UEFI" string to boot in BIOS mode. (In fact, you can get away with installing the BIOS-mode version of GRUB without re-installing all of Ubuntu, but this process is more difficult to explain than just re-installing all of Ubuntu.)

If you want to keep the mixed-mode booting, I know of only two ways to do it:

  • You can use your firmware's built-in boot manager -- the same one you use to select which way to boot an external medium. You'll probably see an option called "ubuntu" to boot Ubuntu in EFI mode and another one that may be named after your hard disk that will boot Windows in BIOS mode. Details vary from one system to another, though, and some don't support switching boot modes at boot time.
  • My rEFInd boot manager can switch boot modes. Boot to Ubuntu and install the rEFInd Debian package, then edit the /boot/efi/EFI/refind/refind.conf file. Look for the scanfor line, uncomment it, and add hdbios to its list of options (leaving the existing ones intact). When you reboot, you should see an option for GRUB, at least one option for booting a Linux kernel directly, and at least one (probably two) options for booting in legacy mode. One of the legacy-mode options should boot Windows. This feature doesn't always work, but it should work on most new computers.