It's not entirely clear why you are checking Row Numbers nor why you have a CTE.
From the problem as you have described it, this simple query will give you the results you need
select EmpId, SUM(DATEDIFF(MINUTE, Times_In, Times_Out)) / 60.0
from Emp_Attendance
where MONTH(Times_In) = 6
GROUP BY EmpId
Note the
.0
on the division to ensure we don't lose any partial hours.