I recently developed an App for Stack Overflow using the Stack Exchange API.
This app is only for fun and I want to add code in Github.
Do I need to add a licence for using the Stack Exchange API?
From the ToS:
By using or accessing the API Services, you agree to become bound by all the terms and conditions of this API Agreement as well as the Stack Exchange Terms of Service.
So that is your license. You, as a user of the service, have to comply to the ToS, including rules about attribution, etc.