First you do not state which SQL you are using so I have assumed SQL Server. When grouping you need to include all fields that do not have a mathematical calculation in and you only need the field required back from the query in the select part of the query.
You can try something like
SELECT doctors.Name, doctors.Surname,COUNT(visits.IdPacients) AS Visits, cabinets.Name
FROM doctors right join visits on doctors.iddoctors = visits.IdDoctors
right join cabinets on visits.IdCabinets = cabinets.idcabinet
WHERE visits.DateHour > '21-Oct-2009'
AND visits.DateHour < '12-Apr-2013' GROUP BY cabinets.Name, doctors.Name, doctors.Surname
BUT; You may have to modify it to suit the table structures you have (unknown to us)
Also have used 21-Oct-2009 to get round different country codes, but this may be different in your situation.