'Longer' is a comparative adjective, so you would use this when the person has already been in the place for some time.
For example, when someone has just arrived in Brazil, you might say:
'How long are you going to stay here?'.
This refers to the total time that they plan to stay in Brazil.
But if you meet someone who has already been in Brazil for a few months, you might say:
'How much longer are you going to stay here?'
This isn't about the total time - it's about the remainder of their stay. You're not asking about the time which they have already been in Brazil, but just about how many more months they're going to be there for.