I completed my Doctoral Degree in less than four years.
I completed my Doctoral Degree in fewer than four years.
Both are grammatically correct. However, using "fewer" here is quite unlikely.
Since you already now that "less" is for uncountable nouns and "fewer" is for countable nouns, it should be simple to see how those can modify the word "year".
When "less" is used, the time to complete the Doctoral can be anywhere between 0 and 4 years, like 3 years + 6 months, which is 3.5 years.
When "fewer" is used, it means the number of years should be an integer or whole number. Here, it can be 0, 1, 2 or 3 years. "3 years and 6 months" is 3.5 years, which isn't an integer number of years, and should go with "less" instead of "fewer".