Should I take a summer class at my university or a community college?
I am assuming this is the USA.
Before you take a course away from the university where you are enrolled, find out if the course credit will transfer.  Probably a minimum grade is required for transfer.  Courses that do not transfer will not help you complete your degree.  Rules vary.
Also, beware that courses can fill up.

Obviously the class will be more rigorous at my university

Well, maybe.  This would vary a lot.  The individual teaching it matters more than the institution.
Summer courses are often taught by different faculty from regular-semester courses.  This is true at both elite universities and community colleges.  Either way you are probably getting a surprise.

but it would be far cheaper to take the class at a CC.

This should be a very important consideration.

Would taking the class at CC have an effect on applying to master's programs?

No, but you will have to order a second transcript, which will be inconvenient.  It might have an effect if you took an advanced class from a community college.  That would cause confusion because community colleges normally have not got advanced classes.