The golf cap has a long brim, which is more used to keep out the sun. Of course, many professional players are used for advertising. Baseball caps have shorter brims to protect the head from blocking the view.
A golf hat is a baseball hat that is used to block the sun. The brim of the hat is not as long as the brim of the golf hat