Follow these steps:
Step 1: Go to Tools > Options
Step 2: Select Query Results
Step 3: Go to SQL Server
Step 4: Choose Results to Text (or Grid if you want) & Include columns headers in the result set
Note: If you want to close and reopen SSMS after changing this option. Then, just go to the SQL Editor Toolbar and select save to file without restarting the SSMS.