You are opening mail application > take cursor on file > new viewer window .

Two mail windows will open , take cursor on window > merge all windows .

Two new tabs will be opened in the mail application , take cursor on file > close tab , now a single tab opened is left ( its your choice to select which tab to be closed , the mail application is opened , take cursor on top left menu bar > mail > click on quit mail .

The correct way is to quit the app and not close its window by clicking on red dot , in normal routine as the applications will not close it will be running in the background , the one you are talking about system preferences > general is for apps .