HaKohen and HaLevi are not names - they are, as you supposed, titles. A Kohen comes from the Priestly Tribe and any direct male descendants will also be Kohanim (priests). HaLevi means that he came from the Tribe of Levi and the same is true for him any direct male descendants will also be Levites.