Chances are you've got two problems....
Mixed-mode install
You wrote:
I turned off Secure Boot in my BIOS and changed the mode from UEFI to LEGACY mode
A lot of pages recommend disabling EFI/UEFI mode and enabling BIOS/CSM/legacy support, but it's BAD ADVICE. The problem is that your computer with Windows 8 pre-installed boots Windows in EFI/UEFI mode. Doing as you described means that you probably installed Ubuntu in BIOS/CSM/legacy mode. Those two boot modes don't get along very well; switching boot modes requires either changing them in your firmware (as you've done, or maybe via the built-in boot manager, if its user interface supports this) or using a third-party boot manager (AFAIK, my own rEFInd is the only one that supports this) to switch boot modes on the fly. At best, this is awkward. At worst, it's impossible -- some EFIs don't support making such switches manually.
At best, you can fix the damage done by using Boot Repair -- but this can work only if you boot it in EFI mode, and even if you boot it in this way, it's not guaranteed to work. It may be just as easy to disable BIOS/CSM/legacy support and re-install Ubuntu.
Note that Ubuntu should install fine with Secure Boot enabled. Disabling it is required on a small minority of computers or if you're dual- or triple-booting with an OS that doesn't support Secure Boot. It's probably best to at least try installing with Secure Boot enabled and disable it only if you run into problems. Note that if you get as far as a GRUB menu, Secure Boot is not a problem.
Sony VAIO flakiness
Some EFIs, including those used by Sony, are broken. They forget their boot order or EFI boot manager entries, and instead boot straight to Windows. There are various workarounds to these problems, which have been covered in other questions here and elsewhere, such as the ones noted by oldfred:
I haven't thoroughly re-read those questions today, but on skimming them, they appear to both assume that Ubuntu was installed in EFI mode, so you'll need to re-install or fix your BIOS/CSM/legacy-mode installation before proceeding.
Note, however, the word I used above: broken. Yes, you can work around problems like this. Do you really want to, though? Would you accept a brand-new car that will start only when the temperature is above 70 degrees Fahrenheit? Would you accept a hammer that will be damaged by hammering nails made of metal? It's the same thing with an EFI that can't remember its boot settings. Manufacturers won't pay attention to such problems unless their figurative noses are shoved into the figurative messes, and that can only be done by returning defective devices and letting the manufacturers know of the problem. Thus, if your computer is new enough and if this is part of your problem, I strongly recommend that you return it and buy something that actually works.