The answer is anytime. It depends on what you want to see. Many people prefer to avoid the tourist crowds of the summer. Some people want to experience the Christmas markets which are open in December. Some people just want to play in the snow! So it really depends on you.
If you ask because you are seeking the perfect weather, we have a page about the weather and some of the things you can do in each season. There is no perfect time to visit The Black Forest because it has something to offer in every season. Rain and snow are always an unpredictable possibility you will want to keep in mind when you book a tour. But even rain or snow can be enjoyable.