Italian usually drops subject pronouns when they are not needed, because the verb ending already shows the subject.
So:
It is talking to one person, informally.
That is because hai is the second person singular form of avere.
So Se hai due mele... means If you have two apples... said to one person you address as tu.
Italian often uses the present tense to talk about a future result when the meaning is clear from context.
So:
This is very common in Italian, especially in everyday speech.
You could also say Se hai due mele, ne mangerò una, but the present mangio is perfectly natural here.
Because this is a normal real condition, and after se Italian usually uses the indicative in this kind of sentence.
For ordinary possible or real situations, se + indicative is standard.
A common learner mistake is trying to use the conditional right after se. In standard Italian, you do not say:
Instead, you use structures like:
But in your sentence, hai is exactly right.
Yes, but that would mean something different.
So the original sentence sounds more direct and real.
The version with avessi / mangerei sounds more hypothetical or less immediate.
The comma is very common and helpful, because it separates the if-clause from the main clause:
In short, everyday writing, you may sometimes see it omitted, but using the comma is standard and clearer.