Can 'close your mouth' mean 'shut your mouth'? I know that 'shut your mouth' is a rude way to say stop speaking. But I need to know whether 'close your mouth' can indirectly mean 'stop speaking' or not?
Not at all.
Shut your mouth's first impression is stop speaking and close your mouth is asking a person to close his jaws. Say,
"Close your mouth fully when you gargle."
Also, close your mouth is opposite to open your mouth and the expression is often used by dentists or doctors. Obviously, using shut there won't be polite. Think opposite. When you want someone to stop speaking close your mouth makes no sense.
Note: Close your mouth is an idiom as well. It asks for this gesture -