Regardless of the matching structure, your employer will likely cap your match at a certain percentage of your income. For example, your employer may pay $0.50 for every $1 you contribute up to 6% of your salary. So if you make $50,000 per year, 6% of your salary is $3,000. If you contribute that much to your 401(k), your employer contributes half the amount -- $1,500 of free money -- as a match. If the company offered a dollar-for-dollar match instead of a partial match, it would give you $3,000 for the year. You're free to contribute more than $3,000 if you want to, but you won't get any additional match from your company.
Companies often create a vesting schedule that determines when you get to keep employer-contributed funds if you leave the company. Immediate vesting means you get to keep all your employer's contributions to your 401(k) as soon as you earn them, but this is rare. It's more common to see cliff vesting, whereby you forfeit all your employer-matched funds if you leave the company before you've worked there a certain number of years. There's also graded vesting, whereby your company releases a portion of your match to you every year -- for example, 20% after the first year, 40% after the second year, and so on.
Every company has its own matching methodology and vesting schedule, so talk to your employer if you're not sure how your 401(k) match works.