If I book a flight ticket and indicate a frequent-flyer program membership number during the booking, will the membership number always appear on the flight ticket or boarding pass?
The answer will potentially depend on the airline involved as there's no standard for things like this, but from my experience...
The Frequent Flyer number WILL appear somewhere on the "ticket". By "ticket", I mean that it will appear on the e-ticket receipt, or when the ticket is viewed on the relevant website. It's certainly possible that you'll need to go looking for it (ie, it might not be visible - you may need to go into the section to change it in order to see it, for example), but it'll be there.
The Frequent Flyer number MIGHT appear on the boarding pass. Generally there will be some indication there there is a frequent flyer number assigned to the passenger, and potentially what status they have, but it's not uncommon for the number itself not to be there, or for it to be truncated/masked in some form.
For example, on a United Airlines boarding pass, my FF number shows up a "UA-*G ******123" which means that my Frequent Flyer number is from United Airlines (UA), I have Star Alliance Gold status (*G), and the last three digits of my number are 123. For security reasons, the entire number is not printed.
As I said, at the start, other airlines will be different...
In my experience, yes, it typically will. (I can't prove that this will always be the case.)
If you don't see your frequent flyer number on your ticket or boarding pass, you should check with the airline to see whether your number was properly linked to your reservation, and to make sure that your miles / points get credited to your account.
(Of course, if the airline tells you "yes, your number is linked, we don't normally print them on the boarding pass", then that obviously should take precedence over this answer.)
Just to confirm Doc's answer, here is an example of boarding pass issued by Alaska airline and with no mention of the frequent flyer program membership number: