What are the optimal wind speed, direction, and surf conditions for windsurfing?
Some of this will depend on your ability, strength and experience.
For beginners, you really want an offshore wind up to about a force 4 maximum with no waves. As beginners tend to use the uphaul method to get the sail up, any stronger wind will make it very difficult.
For an expert, an onshore wind at a force 8 or so can give you much rougher seas, and raise the height of waves to launch off. Experts should also be able to raise the sail to windward, letting it lift them onto the board.
A wind parallel to the shore can be relatively safe once you can tack/gybe comfortably and returning to shore is safe and easy.