Say if you wanted to add "gern" to following sentence: "Nach der Schule, spiele ich Fußball." to make it: "After school, I like playing football." Where would the "gern" go? And if I wanted to replace it with "am liebsten", how would it change?
"Nach der Schule spiele ich gern Fußball."
Note: no comma there.
"am liebsten" can be used instead of "gern" without any other changes.
The way I teach it, gern / lieber / am liebsten come after the verb.
As you’re starting the sentence with the time phrase, you must invert the subject and the verb, so it’s the subject in this “after the verb” position. The gern therefore comes straight after the subject. And as @hans-martin said, don’t be tempted to use the comma after the time phrase, like we might do in English.
I hope this helps.