The effect is more or less the same, don't drink wine or coffee.
If the doctor says quit drinking wine and coffee, it is clear that he knows you are a regular wine and coffee drinker. Avoid drinking wine and coffee is more general advice. You may or may not be a wine and coffee drinker.
Both words are good English, but in my opinion their meanings are slightly different.
Avoid means "stay away from" wine and coffee, at least until you stop being ill. It implies that it might be OK to resume drinking them when you're well again.
Quit, however, would usually imply giving up wine and coffee permanently.