The words are 'sallallahu 'alayhi wa sallam,' meaning 'may Allah send blessings and peace upon him.' They are said whenever his name is mentioned, and are written in English as 'peace be upon him,' 'PBUH' or with the symbol ﷺ. The command comes from the Quran, where believers are told to ask for blessings on the Prophet and salute him with a worthy salutation.
The Prophet ﷺ himself said, 'Whoever sends blessings upon me once, Allah will send blessings upon him ten times.' So Muslims see it as an act of gratitude to the man through whom they received guidance, and as something that benefits the one who says it. It is a prayer for him, not a prayer to him, and it does not mean he is divine.
Muslims greet the other prophets in a similar way, and say 'peace be upon him' after the names of Moses, Jesus, Abraham and others. The Quran does the same: it has peace be upon Noah, upon Abraham, upon Moses and Aaron, and upon all those sent, and records Jesus saying, 'Peace be upon me the day I was born, the day I die and the day I am raised alive.' If you are writing about Muhammad as a non-Muslim, you do not need to add it, and most Muslims do not expect it.