On average, a doctoral program in marine biology would take 5-7 years beyond the undergraduate degree. Programs vary depending on whether or not admissions is into a master's program to be completed prior to or direct admissions into the doctoral program. Programs also differ in the amount of coursework in relation to research hours.
I'd recommend taking a look at the specific programs that you're interested in to find out the specifics. If you're unfamiliar with the graduate programs out there, a preliminary search on the internet will produce a list to start.
Good luck on your academic endeavors!
The responses here are correct. Randall captured the PhD experience very well. I would add that it really depends on how long it takes for you to complete your dissertation research project during your PhD. I have seen projects completed anywhere between 4-7 years depending on funding for the research, how well the project goes (or not), and what is acceptable to your dissertation committee. While coursework is an element of the PhD, the research is more important because a PhD is a research degree and it is expected that graduate students contribute new research to the field. It's a lot of work, but can be gratifying if you have a supportive PhD advisor.
Best of luck,
Often if you go to an undergraduate school with a vigorous graduate program, you may run through the program more quickly if you stay there than if you go to a totally different school in a totally different place. You already know the people and the facilities. It would go faster
But are you really in a hurry? Take from one who has three degrees from three different schools, graduate school should be savored! An MS usually takes about 2 years and often a PhD would be around 4 years. My PhD took 5 years but that was largely because my advisor insisted I take a full load of courses nearly every semester. He said it was because the University offered so many opportunities that will never be available to me again. He was right, of course. As long as the funding held out I could not argue. I will tell you some of the fondest memories of my life were in those years as a graduate student!