When taking classes at another college does it count towards GPA or just credit and hours?

I want to take some classes online from my local community college this summer to get ahead and the class will transfer, but does the grade I get on the online class affect my GPA at the school I am attending or is it more like AP credit where I only get the college credit and hours?

You need to ask at your own college/university. Each place sets its own policy about this. Some will only record credit. Others record grades as well.

In any case, the grades you earn in summer classes will become part of your permanent academic record. You will need to provide official copies of that transcript whenever you apply for admission to a degree program, or for a job that asks for all of your transcripts. A bunch of bad grades from a CC summer session could mess up your overall GPA for grad school admissions or for a job. So don’t slack off just because it is summer, and don’t overload yourself with classes just because you think they will be easier at a CC.