It depends. Some companies match your 401k "as you go", i.e., in each paycheck. Some will wait till the end of the year to give you all the matching funds at one time. In the first case you're ok, in the second case you're SOL. Call HR or check your company policy.
Also check the "vesting period" for the matching funds. Usually you have to have worked for x number of years before you get to keep all of the matched $.