The opportunity cost of earning an advanced college degree is that:

Basically, opportunity cost can be referred to the loss of potential gain from one choosing one thing over the other or from a number of several options. Assume you choose not to go to college and pick up a job after high school. You get a job that pays $30k per year.
After 4 years, you’ll have earned $120k. Assume you decide to go to school and not work while in college. The college fee per year is $30k plus expenses. After 4 years, you will be out $120k. The opportunity cost in this case will be $240k since you chose to go to college instead of working. Thus, you will earn less or no money during the years that you are in college.