How can I add a program to the "Open With" menu on a Mac?
Do you mean the submenu you get when right-clicking on a document? If so, it's generated automatically by Launch Services based on the document types your applications claim to be able to handle. If you look inside an application package (right-click the application, and select Show Package Contents), inside the Contents folder there'll be an Info.plist file with various information about the application, including an array of document types it can open (see Apple's dev documentation here).
TLDR; if the application handles that type of document, it should already be listed; if not, I don't know a way to add it manually.
If you open the "Get Info" window for a file type you're interested in modifying (control click + "Get Info" or ⌘ command + I while the file is selected), you can change the program to the one you want and click "Change All". I've found that this then modifies the "Open With" menu so that if you control click and go to "Open With" now it will show that application because it is the new default. The only downside is that you have to make it the default (I tried changing it back after this and it didn't stick).
It's not quite the perfect solution, but works well enough in my particular case and may be useful for others, and it should be easier / more stable than the plist solution.
macOS High Sierra 10.13.5 (17F77)