Hi Yagoda, thanks for your question!
Ты (you, informal) is used:
-
in the family (Mum, Dad, son, daughter, sister, brother, Granddad, Grandmum, etc);
-
with friends;
-
with people who you know well (colleagues, for example)
Вы (you, formal) is used:
-
with people you meet for the first time (for example, asking the way, in shops, etc.)
-
with people you don´t meet a lot and don´t know well;
-
with people much older than you (say, if you´re 20 and the person you´re speaking with is 60);
-
with people who have a higher status (teacher, boss, etc.)
The rules are the same for written texts and conversations.
It´s also important to remember that when you say ты to a person, you should call him (her) by his (her) name only. The name used is normally short, but the long form is also used sometimes.
For example,
Таня, как у тебя дела? Tania, how are you?
Таня is the short form for Татьяна.
Алексей, как ты? Alexey, how are you?
Алексей is a long form.
If you say Вы to a person, you should use his (her) long name and his (her) patronymic.
For example,
Cергей Николаевич, как Вы? Sergey Nikolaevich, how are you?
Сергей is a long name form, Николаевич is a patronymic.
The second thing to remember is that that Bы (you, polite) is normally written with a capital letter, because it can be easily mixed up with вы (you, plural form, for a group of people).
Kind regards,
Yulia Amlinskaya, Russian Language Teacher.