What is the evolutionary relationship between heme, chlorophyll and other tetrapyrroles?
Note the molecules are not that similar, only one portion is similar.

The similar portion in each molecule is a cyclic tetrapyrroles. Cyclic tetrapyrroles and porphyrins in particular are a fairly common structure in biology they have several functional uses and are fairly easy to construct from existing simpler biological molecules. The fact that they are functionally good at binding metals makes them a reoccuring solution, although not all Cyclic tetrapyrroles bind metals. Many many biological molecules contain Cyclic tetrapyrroles.

Many biological molecules have similar structures to other molecules, especially ones that perform similar tasks, there are only so many shapes you can make with carbon atoms, the shape of a molecule affects its chemical properties and that shape is simple and has useful properties. Heme itself is a functional component of many proteins called hemoproteins, basically whenever they need to bind iron. Another cyclic tetrapyrroles would be cobalamin otherwise known as vitamin B12 which binds cobalt. 

Its the same reason hammer handles look very similar even in very different cultures, just attaching a stick is a simple easy to discover solution, so it is the one that gets found most of the time. Functionally that is the shape that works. Or to put it another way they are only so many shapes you can make a wheel.

https://www.sciencedirect.com/science/article/pii/S0167488912001000

http://www.org-chem.org/yuuki/porphyrin/porphyrin.html

https://www.cpp.edu/~lsstarkey/courses/CHM-Lab/PorphyrinBasics.pdf

https://www.mdpi.com/journal/molecules/special_issues/porphyrin_chemistry

To address the updated question. I honestly don't know if they share an evolutionary origin. But given that they are synthesised in different organelles (mitochondria for heme and chloroplast for chlorophyll, I would guess no.