I configured magit-status to open selected buffer change hunk in other window rather then in the same window with:
(setq magit-display-file-buffer-function
(lambda (buffer)
(setq current-prefix-arg t)
(magit-display-file-buffer-traditional buffer)))
Now when I close status buffer the other window is closed as well and I assume window state is bring back to the one before magit-status was opened.
How can I keep this window and buffer open after closing magit-status window. The solution would be to prevent magit from restoring windows status before magit-status was opened.