Users schedule and customize a message next to their name in Chatter to show the dates and message they are out of the office. You can enable or disable Out of Office in Chatter Settings. Out of Office is available only in Lightning Experience.
Goto Setup -> Chatter Settings -> Click Edit Button -> Out of Office -> Enable Users can set Out of Office messages
Next Find your profile -> Click Out of Office button to set your Out of Office message and this will appear in your profile
Out of Office Message:
Check Set Out of Office Message -> Fill all the necessary information -> Click Save
Result:
Reference Link:
https://help.salesforce.com/articleView?id=collab_admin_out_of_office.htm&type=5
https://help.salesforce.com/articleView?id=collab_profile_out_of_office.htm&type=5