An employee and an employer have both an official and unofficial relationship. Your official employment agreement may lay out work hours, acceptable behaviors, break policies, and the other rules that govern the office and your position in it.
The unofficial side is kind of like the unwritten rules in a professional sport. For example, Major League Baseball teams generally will retaliate if a star player gets hit by a pitch by doing the same to one of the other team's top hitters.
Offices have these sorts of rules, too, and it can be a challenge to know what they are. These aren't the things that get you in trouble with human resources or the boss. These are the mistakes you can make that will turn off your coworkers and leave you as an isolated island.
Don't disrespect seniority
Some people take a job and languish in it for a long time. They may bring little to the table or they may be decent at what they do. Either way, this type of person is often an office fixture. Even if you're senior in responsibility, show respect for people who have a longer tenure at the company than you do.
Those who've been around for the longest periods often have deep connections. They may not be ambitious when it comes to seeking promotions or leaving for a better opportunity, but they know their place in the organization, and sometimes, they know things that can help you avoid making big and unnecessary mistakes.
Don't hog the credit
People often don't have a rational view of their contribution to a project. You may think they barely did anything, while they may think they've been a major contributor.
No matter how much you feel like you led the way, be gracious and share credit liberally. Doing that makes you a leader and enhances what your co-workers think of you -- and the boss will figure out what's happening over time.
Don't be a complainer
Everyone has an occasional workplace complaint. As long as it's innocent and infrequent, that's fine and won't raise any concern. What you don't want to be is one of those negative people who leads the complaints.
You don't have to be relentlessly upbeat, but you should generally be in good spirits. If someone complains too much, others might go along with it, but some of them might be thinking, "If it's so awful, why don't you just leave?"
That's a valid question, and chronic complainers can quickly get a reputation as malcontents. You don't want you co-workers to see you that way.
Don't isolate yourself
Many years ago, I worked for an internet company that was not close to my house. I had a brutal commute, had just gotten married, and frankly, did not like the job very much. Because of that, while I had a few friends on staff, I mostly did my job then went home. I turned down lunch invites to get more work done faster, never went out for dinner or drinks, and generally was not part of the social fabric of the office.
It made it seem like I was already one foot out the door (I was), and isolating myself probably hastened my departure. Even if you don't like your job or plan to leave, you still need to connect with your co-workers, even if only to have it not be obvious you're less-than-engaged.
Just be a good person
Basically, the unwritten rulebook boils down to "be a good person who respects other people." Simple gestures like being more inclusive in your lunch invites or saying hello to everyone the first time you see them goes a long way. Think of how you would expect a child to behave after they've learned proper manners (or how you wish they would); that's a pretty good behavioral guideline.