If a person has the same first name as you, the two of you are tocayos. For example, if your name is Edgar, every other Edgar is your tocayo. If your name is Mária, any other woman named María is your tocaya. A Carlos and Carla could be considered tocayos. It is a surprisingly common relationship.
I once saw two men call each other from across the street as if they were long-separated brothers: ¡Tocayo! With mutual acquaintances, you can reference your tocayo when they’re not present by calling them mi tocayo: ¿Cómo está mi tocayo? How’s my tocayo doing? El otro día vi a tu tocayo en el mercado. The other day I saw your tocayo at the market.
A native speaker was once impressed with my Spanish because I had used the word tocayo. He didn’t expect a foreigner to know that word. It’s not the sort of thing normally taught in school.