Hilchos Lashon Hara chapter 5, section 6
Here is a simple rule in the laws of lashon hara: it depends on who the story is about. Some things are praise when said about one person, and shameful when said about another.
For example: saying about someone who has no worries about making a living that they learn three or four hours a day is very shameful, and it is lashon hara. But saying about a working person who is busy making a living that they learn three or four hours a day is great praise.
The same is true with tzedakah (charity). A gift that is generous for a simple person is shameful for a rich person. The same with how people treat others: the way an ordinary person treats their workers is different from how an important person in Israel treats their workers and servants.
The rule is like the words of the Rambam: anything that, if it becomes known, could cause the other person physical or financial harm – that is lashon hara.
Do not let the yetzer hara (evil inclination) fool you into saying: "'What is hateful to you, do not do to your fellow' – and I would not mind if people said I learn three or four hours a day!" This is a mistake. The Gemara means: if you were on that person's level, this would be hateful to you – so do not do it to your fellow.