I've only sailed on RC and X. They have recommended daily gratuity rates listed on their websites. When we originally started cruising we gave an envelope at the end of the cruise to our room steward and wait team. As we now normally do the flexible dining option, the gratuities are automatically collected when you make final payment instead of being included in your running account on the cruise (though I guess some lines might be different).
DanJ describes the other situations well.
I would only add that we usually tip our wait staff and steward in addition to the base gratuities. One doesn't have to of course but our experience has been that the service we have received during our cruises has been excellent. And the staff truly appreciate the extra tip.