You can either leave it as it is and use “which,” or you can break it into two sentences and use “them”:
When I was a student I had the chance to do four practical internships, two of which were within the company.
or
When I was a student I had the chance to do four practical internships. Two of them were within the company.
The first sounds more formal than the second, so it would be better in a formal document like a resumé. But both of these are OK, and they mean the same thing.