If I read the whole sentence
If so many men, so many minds, certainly so many hearts, so many kinds of love.
I read it as
If there are 20 men, there are as many minds, certainly as many hearts, as many kinds of love.
In other words, everybody is different, no two men are the same, in mind, in heart, and certainly in kinds of love.
(The 20 is just an example; you have as many minds as you have men)
The shortened expression "so many men, so many minds" means that you have as many minds (or opinions) as you have people. In other words, everybody has his own mind, don't assume people will think like others.
A variation on that theme, ascribed to Clint Eastwood (as Dirty Harry):
Opinions are like assholes; everybody has one.
That version is probably in more common use. I don't think that "so many men, so many minds" is a common expression, and I doubt many people will recognize the quote. It is a nice aphorism though.