After every match in APEX LEGENDS, you will see a summary of all your actions. This is where you will get XP. The amount of received points depends on actions performed in that match. The more kills you got and the longer you survived, the more XP you get.
What do I get for leveling up?
By leveling up, you can get either Apex packs or Legend tokens, or both rewards at the same time.
Is there a maximum level?
Currently, the maximum level is 100. After reaching that level, you will get legendary tokens every time you collect enough XP.