org-agenda-restore-windows-after-quit

org-agenda-restore-windows-after-quit is a variable defined in `org-agenda.el'.
Its value is
nil


Documentation:
Non-nil means restore window configuration upon exiting agenda.
Before the window configuration is changed for displaying the agenda,
the current status is recorded. When the agenda is exited with
`q' or `x' and this option is set, the old state is restored. If
`org-agenda-window-setup' is `other-frame', the value of this
option will be ignored.

You can customize this variable.