I'm trying to query the Customer and Partner Portal Roles. I was able to find the PartnerRole, UserRole objects but didn't find any CustomerRole one.
Are these the objects I need to query? How do I find out about the Customer Portal roles?
There isn't one. Customer Portal Roles (as well as Partner Roles) are stored in the UserRole object. The PartnerRole object is picklist definition object which defines the values for for AccountPartner.PartnerRole, much like OpportunityStage does for Opportunity.Stage.
To distinguish between regular, partner portal, and customer portal roles filter on the PortalType field. For example: