Well,it is generally advised to Install windows first since GRUB detects Windows. If you install windows later, the windows boot manager doesn't detect Ubuntu and automatically starts Ubuntu. But there is a solution.
Don't erase the Ubuntu partition.
Create another partition for windows.
Install windows.
Burn an iso of Ubuntu on a usb stick or a DVD.
After Installing windows boot ubuntu live session from the USB.
Boot from the live CD. Open the terminal
sudo add-apt-repository ppa:yannubuntu/boot-repair && sudo apt-get update
-Press Enter - Then type:
sudo apt-get install -y boot-repair && boot-repair
Then open boot repair. Perform recommended repairs. This Will solve the problem and Show you Grub menu with the option of choosing either windows or Ubuntu. If that doesn't solve it(Which I highly doubt that it wouldn't solve your problem), paste the link provided from the boot repair here.