This entire lesson has errors in nearly every English translation. Suggest the editors do a thorough review. The challenge is that the Indonesian can be imprecise and be reflected in English in multiple ways. The only way to get through the lesson is to use the Word Bank instead of typing natural English translations.
I am just learning like you, but what it seems to be according to me is: Pagi: the morning
Siang: the noon and early afternoon
Sore: the late afternoon until evening
Petang: when sun is set but it's not completely dark yet, the dusk, night is about to arrive closely
Malam: night. As long as there is no sunlight whatsoever.
if it's still light out, it's considered Sore, once the sun goes down, it's Malam. Confusing because, in the US, we can say it's evening before the sun goes down. The kicker is that Duolingo uses Petang/Sore/Malam so interchangeably, it'll say "afternoon" and we get rejected for using Sore, because they were looking for Petang, and visa versa. I have two factories in Jakarta and I pass some of this stuff by the locals and they just go, "Huh?". I'm there about two months a year, have never heard anyone use Petang.