Pilots, fortunately, have an additional seat that cannot be taken by a paying passenger. Each airliner has one or two additional seats in the cockpit known as jumpseats. These are required for use by company check airmen or FAA inspectors conducting line checks, but that's a fairly rare circumstance. Most of the time, the jumpseat can be used by commuting pilots whenever the cabin is full. Pilots from the same airline have precedence; after that, it's available to other airline pilots on a first-come/first-served basis. In any event, use of the jumpseat is always at the Captain's discretion.
For obvious security reasons, I'm not going to go into the procedure for requesting and obtaining jumpseat access. I will mention jumpseat ettiquette...it is imperative to remember that the captain is extending a courtesy to you, and one should act accordingly. That means asking his permission, staying out of the way, being polite to the whole crew, cleaning up after yourself, and thanking the crew after the flight. You should observe sterile cockpit rules, and only talk at other times if the crew feels like chatting.
From a crewmember's standpoint, I don't mind having jumpseaters along. Yes, they're taking up extra space, but the our cockpit is pretty big. After talking to the same captain for three days straight, it's nice to have someone else to converse with. You'd think the extra set of eyes would put extra pressure on you, but you don't notice when you're busy. In fact, I had a jumpseater in the cockpit during my smoke-in-cabin emergency a few months back, and I almost forgot he was there.
The one situation I dislike is when you have an extremely chatty captain, and he starts talking to the jumpseater as soon as the gear is up and doesn't stop talking until the landing checklist. It's obviously violating "sterile cockpit," and in extreme cases can begin to affect safety. In one extreme case, they weren't catching my heavy hints to shut up, so I turned off my intercom so I could hear ATC. So...if you're ever riding along with me when I'm flying with that sort of captain: please, don't encourage him. I understand that ettiquette demands that you play nice with the captain, but you can surely get less chatty once my body language is telling you that it might not be such a great idea to be blathering away at 3000' in congested airspace.
Incidently, we don't have jumpseat access on international flights, and it's irritating. Loads to Europe have been rather high this summer.