Depending on what you mean by tab, one of the following should work:
" size of a hard tabstop
set tabstop=4
" size of an "indent"
set shiftwidth=4
" a combination of spaces and tabs are used to simulate tab stops at a width
" other than the (hard)tabstop
set softtabstop=4
You may also want to try the following:
" make "tab" insert indents instead of tabs at the beginning of a line
set smarttab
" always uses spaces instead of tab characters
set expandtab
See :help 'optionname' (eg: :help 'tabstop') for more details on any of these.
tl;dr
In a codebase that uses 4 space characters for each indent, here are good settings to start with:
set tabstop=8 softtabstop=0 expandtab shiftwidth=4 smarttab
In a codebase that uses a single tab character that appears 4-spaces-wide for each indent these settings should work:
set tabstop=4 softtabstop=0 noexpandtab shiftwidth=4