Most rewards programs send you a card you can carry -- if you don't have it, just have the reward program number written on a piece of paper and give it at check in.
You can join the programs by filling out a form found at the reception desks in most hotels. Or, you can typically apply online on the hotel website (ie. marriott.com. hilton.com, etc)
I am a member of all the reward programs. As others have said here, when your company pays for your room, some hotels will let you keep the points for the stay. Conversely, at others, you get no points for the cost of the room.
In any case, you can definitely earn points for anything additional you charge to your room (room service, restaurant & bar charges, movies, etc.). I charge as much as possible to my room when eating/drinking in the hotel. Plus, on the occasions when I pay for my own hotel stays while travelling on my own, I get to keep all the points.
Some hotel reward programs also give you airline miles for the airline frequent flyer program of your choice -- an added benefit.