As a general rule, you want to try to go to different institutions to learn from different people, learn different ways of doing things, etc. It is often frowned upon to go to the same institution for grad school as for undergrad. I have heard this referred to as “inbreeding” before. As happymom mentioned above, a masters/PhD from the same program is not typically frowned upon as much as undergrad/grad at the same place.