The Origins of the Legend of the Red String of Fate
According to Wikipedia:
The red string of fate, also referred to as the red thread of destiny, red thread of fate, and other variants, is an East Asian belief originating from Chinese legend and is also used in Japanese legend. According to this myth, the gods tie an invisible red string around the ankles of men and women who are destined to be soul mates and will one day marry each other. Often, in Japanese culture, it is thought to be tied around the little finger. According to Chinese legend, the deity in charge of “the red thread” is believed to be Yue Xia Lao (月下老) (often abbreviated to “Yuelao” [月老]), the old lunar matchmaker god who is also in charge of marriages.
The two people connected by the red thread are destined lovers, regardless of time, place or circumstances. This magical cord may stretch or tangle, but never break. This myth is similar to the Western concept of soulmates or a twin flame.
According to TV Tropes:
A common concept, especially in series dealing with romances, is the Red String of Fate (akai ito or unmei no akai ito). The concept is that two people who are destined to be together are attached by an invisible red string bound from a male’s thumb to a female’s pinky finger (generally, though not always, at the first knuckle from the fingernail; also, nowadays it’s become more common to show both parties attached at the pinky).
It is an East Asian belief originating from Chinese legend, with people claiming many different countries of origin and/or religions for it, but the usage is clear regardless. The trope is so pervasive that merely holding up the thumb is used as shorthand for girlfriend, and holding a pinky up would indicate a boyfriend.