I just watched Toaru Kagaku no Railgun. It seems like Kuroko is in love with Misaka (?) and calls her "onee-sama", but when did it start? And why/how did this happen?
Onee-sama is commonly used in an idol-follower relationship between women, usually signifying extreme adoration on the part of the follower so on the surface it can look like Kuroko idolized Misaka because she's a Level 5.
However, we see that Kuroko sees Misaka as something than an Idol ie. groping her in the showers, getting jealous of any man being with her or wanting to see her, stealing her underwear,
she has obviously done this before as she knew that the real Misaka would attack her if she stole her underwear using her Esper powers proving the one she was with was the real Misaka
this would indicate that Kuroko has feelings for Misaka which are ignored by Misaka possibly passing it off as just Kuroko's personality.
This would be a subset of the idol-follower type of relationship, signalling a lesbian relationship with the youngest of the couple referring to the oldest one as "Onee-sama", this is common in Shoujo Ai/Yuri where the youngest adores her older partner and the term is used to demonstrate how strong they feel as wanting to be a family with them.
However there are times where the oldest in the couple find this as a sort of "turn on", in the first Sono Hanabira game Yuuna gets Nanami to call her Onee-sama and the moment Nanami does we can see the euphoria in Yuuna as Yuuna keeps requesting Nanami to "say it again" and tries to get her to use it in conjunction with some lewd talk (to which Nanami releaises what she is about to say and stops it), Yuuna also tried to get Sara in the second game call Kaede Onee-sama but after a couple of uses Sara chooses not to.
Now as for the second part to your question, while i have yet to read the light novels, given Kuroko's personality it may have started when Misaka and her first met being "love at first sight", i remember Kuroko mentioning she had to "pull some strings" to get her and Misaka to share the same room and given how Misaka is used to Kuroko actions and how Kuroko is used to being "punished" it would indicate it's been going on for quite a while
In traditional Asian countries (like in Southeast Asia, China, Japan, etc.), you can address someone close to you as "older sibling" or "younger sibling" if their age is not far from yours, but if they are much older than you, sometimes you can address them as "Uncle" or "Aunt" even if they are not actually your family.
This applies to many anime due to Japanese tradition. Kuroko gives respect to Misaka as someone older than her, but calling such people "X-sama" primarily only happens in fiction. However, sometimes this term of address is actually used in family that have a perspective based in ancient tradition (like yakuza families, etc.), but this is not too common.
Note that calling someone "Uncle"/"Aunt" sometimes may not be polite (especially if the age difference is not substantial), because it makes it seem as you are treating them as old. Most of the time, in Asian tradition, we use just a word meaning "older/younger sibling" instead.