It means buddy. Same root for friend as in Hebrew and semitic languages – but I think only men say it to other men. It’s more affectionate than friend, it’s like pal or buddy.
It’s in Hebrew slang as well.
When I put Haviv (same letters as Habib – I won’t go into it – it’s Hebrew) into google translate – it reminded me that it means favourite – and when I added the last letter – the “ee” sound at the end of the phonetic Habibi – it came up with buddy. I see the connection – my favourite, my favourite friend, my buddy.