What you're asking here is both trivial and needs attention to specific details in order as to not invalidate the "install Windows later" plan.
Firstly, this answer deals with only one detail of your question that was, after all, just a side remark. However tangential as it may seem, it touches on very important information the casual users are seldom familiar with. Namely it mentions that no product key is needed to install Windows 10. Also of note is oldfred's comment under your question:
If system was originally Windows the product key is in UEFI and will be reused with new install.
So, in a nutshell, please know that you can install Windows first if you're more comfortable with the approach and if the computer has had Windows already installed and is UEFI then you don't need to enter the product key again or ever.
The other answer starts by answering the gist of your question correctly. But then uses wrong terminology - and the distinctions that answer refuses to make can potentially ruin the whole plan -, wrong facts and incorrect suggestions.
To start with something there are already canonical answers to this hugely popular topic:
How can I install Windows after I've installed Ubuntu?
And specifically for UEFI: this answer
So, in summary, if you opt for installing Ubuntu now and later install Windows 10, here's what you absolutely need to know -and- plan ahead:
- Know your computer, first and foremost; you need to know whether its firmware is the 40 years old BIOS or the new UEFI. Windows has strict requirements regarding partitioning - MBR ("msdos" or "dos") for BIOS installations and GPT for UEFI installations - therefore you must prepare your drive(s) accordingly beforehand (Ubuntu has no such requirements but it's always better to have GPT unless Windows in BIOS mode is in the equation)
- Prepare your target drive accordingly the follow-up of #1; use Gparted in the live session, before starting the actual installation, select your drive and then use the Devices menu > Create partition table... and select accordingly
- Install Ubuntu preferably using Something Else so you can set size of ESP,
/
(root). and /home
, if desired, leaving the space intended for Windows unallocated, not because Windows can't be installed in an already formated partition (it CAN be installed in any NTFS formatted partition) but because it's preferable and easier to just leave blank space that the other OS installer will use later and partition as it wants.
- If BIOS you MUST use MBR and you're strongly advised to install Windows first. With BIOS only one bootloader can be used per drive (at the MBR); installing Windows after Ubuntu will remove the Ubuntu bootloader and install Windows's and the result is an unbootable Ubuntu, situation that can be corrected - reinstalling Grub - but it's preferable to be avoided altogether (cf. next point)
- Understand that the Windows bootloader can't be used for dual- or multi-booting except when only other Windows are involved (and regardless of BIOS or UEFI modes); the other answer incorrectly suggests - perhaps unintentionally - that Grub is optional; IT ISN'T; you may use a third and more complex to integrate rEFInd bootloader but you won't certainly be using Windows; there's really no need for added complexity for something that, again, is trivial
- "Windows may install its boot manager to the EFI partition that GRUB makes, or it may make it's own" (from the other answer) is wrong on two counts; Windows installer necessarily, not optionally, installs its own bootloader in the ESP (EFI System Partition) and the ESP is not "made by Grub"; it's created by the installer or created by the user with manual partitioning as alluded to in #3
- Knowing how to manage the boot order in the firmware IS imperative! If BIOS you need to assure the drive where the Grub has been installed has the first priority (it usually has, there should be no change from Windows only to the dual-boot with Grub the original Windows bootloader) but if UEFI you need to first assure the drive containing the ESP has the first priority and then change the "OS Selection" to "Ubuntu" (or back to... assuming that in this case Ubuntu has been installed first), two different settings that vary a lot depending on the manufacturer.
- After installing Windows and setting the boot back to Ubuntu (Grub), it won't be "aware" of the new Windows and will boot Ubuntu directly; Open the terminal and run
sudo update-grub