What's the name of that feature that auto indent the code when I press tab (Even fi the indentation is more to the right, the tab "erases" the abundany spaces) and how can I change the size of it?
As said in comments, the behaviour of tab changes often depending on the mode you are using.
I suggest you read more how the indentation works in Emacs in the wiki
Main variables are:
c-basic-offset: The basic indentation offset in CC Mode, default is 2. For Perl, it is controlled by cperl-indent-level.
tab-width: How wide a tab is, default is 8.