I was wondering whether the following sentence takes a singular or a plural verb:
Years of experience in writing theses has lent him deep knowledge about engineering as a subject.
I disagree with Tushar Raj's answer: I don't think "Years of experience has taught him it's wrong" is preferable to or more correct than "Years of experience have taught him it's wrong."
My feeling is that either have or has is fine in sentences like this, and this gets some limited (because there are so few hits) support from a Google Ngram query:
"Years/years of experience have taught" is actually more common here than "years of experience has taught".
The Corpus of Contemporary American English (COCA) has 2 hits for "years of experience has" vs. 11 hits for "years of experience have". Among the hits for "years of experience have" are sentences like "Years of experience have taught me to trust my subconscious" and "Years of experience have taught her to judge when a person is likely to...."
So I would say that have is fine in the sentence from the question ("Years of experience in writing theses has/have lent him deep knowledge about engineering as a subject"). Has may be fine too (in my opinion, it is), but it's not the only correct choice, and based on the corpus evidence that I have looked at it doesn't seem to be the most common choice, so I wouldn't say that has is "better".
I agree that "Years of experience have gone by so quickly" is preferable to "Years of experience has gone by so quickly".
It depends on which word in the phrase you need to agree with based on your sentence.
Years of experience has taught him it's wrong.
experience is being agreed with
Years of experience have gone by so quickly.
Doesn't make much sense; just illustrating the point that
years is being agreed with.
has is the better choice for the example sentence in your OP.