It literally means "so" or "then", but it also can be used for positive replies or when leaving.
For example,
I'll leave now or I think I should get going now.
= 그럼.
= 그럼 전 이만.
= 그럼 전 이만 가보겠습니다.
Are you coming?(올거지?)
Definitely!(=그럼)
So, I can say both are correct.^^/
\^o^/