The DC (Difficulty Class - the number your target has to roll above) for your spells is largely determined by your stats and your class. High stats increase the DC, and your class determines which stat in particular needs to be high. Clerics and Rangers benefit from Wisdom, Wizards from Intellect, and Warlocks from Charisma.
Just as @fishworshipper (amazing name) said. Your spellcasting ability (intelligence, wisdom, charisma; depending on class) will determine how hard your spells hit and how hard they are to resist.
Example:
You have a wizard with 15 intelligence, which means you'll have a +2 to intelligence.
The D&D handbook explains the spell DC as followed: 8 + proficiency + int mod = 8 + 2 + 2 = 12. (proficiency is usually +2 at the start, and as a spellcaster, you're proficient with casting spells of course).
Thanks for answering guys
But I tried to cast this spell by Wizard with 17 or 18 Int and by Cleric with Magic Initiate feat and 10 INT (according to feat's discription Clerics also use INT for cast). Profiiciency +2.
DC was the same three times - 12.