Referring specifically to A Thousand Splendid Suns, the quotation is the promise that Tariq makes to Laila in Chapter 50. Laila has decided that she wants to leave her tranquil life in the relative paradise of Murree, Pakistan for her war-ravaged home in Kabul. She is unsure of Tariq's response, and she only wants to return if Tariq is willing. She should not have had to ask. Tariq has always loved Laila, and she has always dreamed of a life with him. He knows that she has looked past his missing leg, and his days in prison, and he already has returned once to Afghanistan to find her. Knowing the terrible life that Laila has already endured with Shaheed, Tariq is not about to let his true love down now. Perhaps there is nowhere worse to return to than Kabul--symbolically, the end of the world--but Tariq will willingly follow her there.
I think the simple answer is that it's a statement of utmost loyalty. To tell someone that you'll "follow" them to the "end of the world" pretty much means that you'll follow them to the death. Now normally the end of the world is obviously associated with Armageddon, but in this case, since the saying starts with a physical verb such as "I'll follow", it could also be referring to Flat Earth theory where people commonly believed that after a reaching a certain point, the Earth just stopped and you could fall off (see image). I don't exactly know the origins of the phrase, but it's possible it got coined around the Medieval times, if it is related to the latter possibility?
Either way, it's important because it implies unconditional love, trust, and fidelity to whoever it is being said to. Even though it may have started out as a semi-literal expression (and arguably still is) it's still an extreme statement, saying even if they make mistakes or do bad things, they'll still have you staying by their side through everything.
Hope that helped a bit.