From the ELisp manual:
-- Function: set-window-margins window left &optional right
This function specifies the margin widths for window
WINDOW, in
character cell units. The argument LEFT controls the left
margin,
and RIGHT controls the right margin (default ‘0’).
If WINDOW is not large enough to accommodate margins of the
desired
width, this leaves the margins of WINDOW unchanged.
The values specified here may be later overridden by
invoking
‘set-window-buffer’ (*note Buffers and Windows::) on WINDOW
with
its KEEP-MARGINS argument ‘nil’ or omitted.