後 (ご) is pretty much only used as a suffix after fixed time-expressions (time period or duration): 一時間後 / いちじかんご, 放課後 / ほうかご. Attaches directly to Sino-Japanese nouns (漢語). For example 朝食を済ませた+ご wouldn't work. It can't follow clauses or verb phrases.
放課後 can be understood as "after the duration of school hours"
後 (あと) is usually used along with の, and can follow events, actions, or whole clauses. 朝食のあと or 朝食を済ませたあと. It's more flexible and common in speech.
朝食のあと - more casual
朝食後 (ご) - more formal
放課後 (ご) - natural, I hear it even in informal contexts (放課のあと makes no sense)
授業のあと - slightly more casual
I think when both options are available, it's safe to just go with with あと, at least in everyday Japanese. However, some ご compounds are set / conventional. It's always going to be 午後 (ご), never 午の後 (あと).
その後 is an interesting case, as it can be read either そのあと (more common) or そのご (more formal)
PS: You'll eventually just get a feel for how they're used. I can't really give you every case. The rule should get you most of the way there though.