Does the hadeeth about
changing evil actions mean to change it by leaving the place where it is
happening, or should we stay there and hate it and denounce it in our
hearts?

Praise be to Allaah. 

There
are varying degrees with regard to the Muslims denouncing evil actions.
Some have to deal with the evil action by their hands (i.e., by taking
action), such as the imaam or leader, or his deputy to whom he has given
authority, e.g. a father with his children, a master with his slave, a
husband with his wife, if the person who is committing the sin cannot be
stopped in any other way. Some people are obliged to deal with the evil
action by giving advice, teaching others, telling them off, rebuking them
or calling them in a manner that is best, without taking action or using
force, lest that provoke fitnah
(tribulation) and spread chaos. Some people have to respond to the evil
action in their hearts only, because they are too weak to take action or
speak out – and that is the weakest of faith. The Prophet
(peace
and blessings of Allaah be upon him) explained that in his hadeeth:

“Whoever
among you sees an evil action, let him change it with his hand (by taking
action); and if he cannot do that, then with his tongue (by speaking out);
and if he cannot do that, then with his heart (by believing that it is
wrong and hating it) – and that is the weakest of faith.” (Narrated by Muslim
in his Saheeh from the
hadeeth of Abu Sa’eed al-Khudri (may Allaah be pleased with him).
If the interests of sharee’ah are better served by a person’s staying
in the environment where the evil action is taking place, and they
outweigh the negative outcomes, and he does not fear that he will be
overcome by temptation if he stays among people who are committing this
sin, and he also denounces it according to his means, (this is OK);
otherwise, he should forsake them in order to protect his own commitment
to religion.