The 8 is a national prefix, the 7 is the country code. Mixing them up is the most common dialing mistake.
Two different things
8 is the national trunk prefix: it tells the network "this is a long-distance call inside the country". +7 is the country code of Russia and Kazakhstan in the international numbering plan.
Domestic dialing
8, then the area code (495, 812) or the mobile code (900, 916), then the subscriber number. From a mobile phone the 8 is often optional — the network accepts the number without it.
International dialing
From abroad: the exit code of your country (00 in most of Europe, 011 in the USA, 810 in Russia), then 7, then the number without the leading 8. So 8 495 123-45-67 becomes +7 495 123-45-67.
Why the confusion is costly
Dialing 8 7 495… adds a digit and the call fails. The same happens when someone keeps the leading zero of a foreign city code: +39 06… becomes +39 6… and the number is wrong.
Universal rule
Store numbers with a plus and the country code. Then they work from any country, in roaming, and in messengers.
See also: reading an international number, Russian area codes.