How can I apply for my (resigned) team leader's position?
Every company has a different process for hiring.
First, you should make it known that you would like the position. Often, that involves talking with your (former) leader's boss.
Think about what you want and why you want it. Make sure you can talk about why you are now a good fit for the role. Then go talk to the leader's boss and discuss it. Ask if you would be considered for the role. If the answer is Yes, ask him/her what are the next steps to pursue that job.
If you are on good terms with your team leader, you may want to ask that he put in a good word for you. Think this through carefully. If you believe that he would support your candidacy for the job, then go ahead and ask. If you don't think he could see you in his role, then don't ask - it could do more harm than good.
If the company posts the job formally, you may need to go through the interview process - similar to how an external candidate would. If you are interviewed, one question that is certain to come up is how you would handle being the new leader of your current coworkers. Think that one through so that you'll have a great answer.
Many companies love to promote people internally. That can be a very good thing for all. But sometimes, companies want to bring in someone fresh - perhaps with higher qualifications or new ideas.
For your company, you are in a better position to tell if they prefered internal or external candidates for openings in the past.