Good work mate, but have to correct a few things.
As you said : If you go to a class, you will learn English. (ඔයා පන්තියට යනව නම්,ඔයා ඉංග්රි,සි ඉගෙන ගනිවි.)
Similarly you have to add the "S" for the following sentences as they are singular and also remove the unnecessary terms like "for" etc....
If you come, I will come. (ඔයා එනව නම් මාත් එන්නම්.)
If he hurries, he will catch the train. (එයා ඉක්මන් කරනව නම්, කෝච්චිය අල්ල ගනිවි. )
If she asks me, I will tell her. (එයා මගෙන් ඇහුවොත් ,මං එයාට කියන්නම්. )
If you take leave , I will come to see you. (ඔයා නිවාඩු ගන්න නම් මං ඔයාව හමුවන්නම්. )
If I promise, I will marry her. (මං පොරොන්දු වුනොත්,මං එයාව බදිනවා.)
The below sentence does not need the term "to".
I will bring the mobile phone in case you phone me.
මං මොබයිල් ෆොන් එක ගෙනියන්නම් හදිසියෙවත් ඔයාට මට ෆොන් කරන්න ඕන වුනොත් කියලා.