What role does undergraduate school play in applying for graduate school?
Graduate school is much more competitive than undergraduate because they don't accept as many students. Each graduate school will have different requirements depending on the program, but all of them will look at your GPA and the relative coursework you completed. Some also require letters of recommendation from your professors.
Your undergraduate academic record is very important when applying to graduate schools! Graduate programs are typically more discerning than undergraduate because they do not accept as many students. Programs are smaller. Many graduate programs will require at least a 3.0 GPA but others may allow a slightly lower GPA with some stipulations. Depending on the graduate program you are applying to, you may have to complete prerequisite courses before being considered. This is the case for many science and pre-health graduate programs. Graduate programs vary a lot, but I hope this helps!
The other 2 responses are spot on. I would just like to add that you will also need to complete your undergraduate degree at a regionally accredited university to get into most Master's programs. This is extremely important. There are national and regional accreditations. You will want regional.