Here is the website for you motherboard.
https://www.gigabyte.com/Motherboard/GA-970A-UD3P-rev-10#ov
Look at the photo of the top down view of the mobo. Around the socket there are two brackets that screwed into the socket. This is where your cooler will hook up too. It has been awhile since I built a PC with a 8350, so I cant remember if the brakets come preinstalled on the motherboard (I think they do) or if they are part of the package contents or if they come with the CPU stock cooler.
If you bought the mobo used, they may have taken the bracket off for a different cooler, in that case, you will need to buy the AM3 bracket or an aftermarket cooler that comes with a bracket.
If you are going to overclock this chip, which I recommend you do, then you will need a better cooler than the stock cooler provided.