Sometimes they are interchangeable: after I think,  I imagine or using if.
Which to use depends very much on the context, the other words in the sentence and the exact meaning:  Sometimes there is no difference and sometimes the difference can be quite subtle.
Here are some examples of how I would use them:
 
Look at the clouds. I think it �s going to rain.
Look at the clouds. I think it  �ll rain later today.
 
He �s going to fail his exams if he doesn �t do enough study.
He �ll fail his exams if he doesn �t do enough study.
 
He �s going to fail his exams because he hasn �t done enough study.
 
 
He �ll be back at 4 o �clock. 
He �s going to be back at 4 o �clock.
He will be away most of the afternoon.
He �s going to be away most of the afternoon.
 
He �s going to paint the fence. 
He �s going to paint the fence when he �s finished fixing the gate.
He �ll paint the fence when he �s finished fixing the gate.