Both talk about the future, but they have different uses. 'Going to' is for plans and evidence. 'Will' is for spontaneous decisions and opinions.
Practice tip: Ask yourself: Did I already decide this? (going to) Or am I deciding right now? (will) Can I see evidence? (going to) Or is it my opinion? (will)