So you want to go to grad school
A computer science undergraduate degree prepares students well to enter the job market, but graduates are not limited to directly entering industry. Many students opt to continue their education, obtaining Master's and doctoral degrees.
Types of graduate degrees
Depending on the program and school, a graduate degree can take anywhere from 9 months (for some master's degrees) to 5 or more years (for PhDs), and programs vary from being primarily taught to consisting entirely of independent research under the guidance of an advisor.
As a general rule -- although there are many exceptions -- most PhD programs in the US don't require applicants to first get a master's degree, whereas most PhD programs outside of the US either require or strongly prefer applicants to at least have completed graduate-level coursework. In fact, some US schools require all prospective graduate students to apply to their PhD program, offering the option of terminating studies after the required courses for a master's degree have been completed.
Preparing to apply
When applying to grad schools it's very helpful to have good relationships with your professors, as letters of recommendation carry a great deal of weight in the admissions process. Going to office hours and taking on research projects are great ways to develop relationships with the people whom you may need to ask for recommendation letters in the future. Many grad programs also require students to write the GRE. There's no subject-specific GRE for computer science, so most CS programs just require the general GRE. This requirement is especially common in US universities.
Some applications will also require a statement of purpose, in which you are expected to outline the research you plan on conducting during your studies. There are many resources available online on writing these, such as this from Berkeley.