What Borek said.
You have two competing factors here. As the charge increases on the ions the bonds get stronger. However, as the distance between atoms increases the bonds get weaker. Let's look at your situation using data first:
Melting Points
-----------------
MgO - 2852 °C
BaO - 1923 °C
NaCl - 801 °C
KCl - 790 °C
As you can see the +2 ions (Mg
+2 and Ba
+2) have much higher melting points than the +1 ions (Na
+1 and K
+1). Now if you compare the two +2 ions, magnesium has a much smaller radius than barium which appears further down on the periodic table. You would predict MgO to have a higher melting point than BaO for that reason (much higher because they are far apart on the table). Similarly, potassium has a larger radius than sodium which you can infer from its position on the periodic table. So NaCl has a higher melting point than KCl (but not by much as they are quite close on the table).