How does the tenure process work I am curious to know how the tenure granting process works in the US. How much weight is given to research, teaching, and service. I have heard that a lot depends on your relationship with your peers - department colleagues. If they feel you are a good fit, you can be granted tenure even though you have less than a stellar record. 

Is there a minimum requirement for number of publications. Do publications before joining the institution count? I would appreciate your inputs.
The two most important considerations are publications and teaching: you have to have enough good publications, and you have to be not horrid at teaching. This assumes a typical teaching, research and service obligation -- research won't matter in a teaching-only position, and vice versa. Although teaching is usually considered to officially take up more of your time, research is usually given greater weight in a research institution, and teaching in teaching-oriented schools. Teaching tends to matter less than research in sciences, and teaching tends to be more important in humanities.

Officially, collegiality is in last place and is in some institutions forbidden as a criterion. However, likeability can influence people's subjective evaluations of other criteria. There is a growing trend to require departments to have explicit criteria, for instance stating that a book is required, or that the norm is 3 peer-reviewed publications per year. I understand it to be the normal case that all of your publications are part of the tenure package.

The external evaluations are, in my opinion, more important as a measure of your research productivity than the raw number of publications, so a huge number of crappy papers will do you no good, unless you can get a lot of crappy referees too.