Yes. In the English language the comma is a separator. Without the comma placement in that sentence, it would become a run-on. This is known as an if/then statement. Another example of its usage is: If you need anything at all, please ask. When you feel you are presenting an if/then statement, make sure to add a comma.