A typical Bachelor of Science in Computer Science takes 4 years to complete but some schools offer accelerated programs.
To earn a Master's Degree is usually around an additional 2-3 years.
For many companies there is no set "you must complete X years of school to work here". I have worked with a number of people who have a diverse set of educational backgrounds. Some did 4 years and earned a Bachelor's Degree. Some earned their Master's Degree. Some completed a Coding Bootcamp which takes around 3 to 6 months. Some are even self taught and never had any formal education in Computer Science.
The biggest thing though is that you never stop learning. All great software engineers are life long learners!
If you are just interested in programming, web design, data processing and analytics, etc., then you don't technically even need a college degree (unless you want to get into the likes of Google, Facebook, etc.; they will likely require at least a bachelors, or many years of equivalent industry experience). I have coworkers who went to coding academies and who are just as capable as I am at our jobs. So really ask yourself what you want first! :)
Get commercial experience as soon as you possibly can. That's when the actual learning begins.
Note that this isn't an indictment on learning from reading books and academia. It's just that you can't deeply learn those concepts without receiving hands on experience in parallel. Double-loop learning is a good concept to look up.
You can study your whole life and have a bible of degrees, but still wont be able to perform in real world.
Learning to pass is much different of learning to DO! I suggest to focus on the second as it will make your life easier during your working life.
Dinesh recommends the following next steps: