Puede simplificar su consulta y usar LEAST función
SELECT USERid, LEAST(7, COUNT(*))
FROM table
GROUP BY USERid
de la pregunta en tu comentario
SELECT SUM(countByUser)
FROM
(SELECT LEAST(7, COUNT(*)) as countByUser
FROM table
GROUP BY USERid) c