In English, you can either write I am or I'm, but in French, some contractions are obligatory and it's actually called "elision".
So words like je, me, te, se, ce, de, le, ne, or que, have their E replaced by an apostrophe, and there's no more space before the next word, if that next word starts with a vowel (A E I O U Y or even with an H sometimes).
Je suis => "Suis" starts with a consonant => Nothing changes.
Je ai => "Ai" starts with a vowel => It has to be written "j'ai".
Also, si+il = s'il. It's a special case and "si elle" can't be "s'elle".