The previous answer is good. However the question leaves other questions. For instance, are you being offered a raise or a contribution to the 401K or are you getting a 3% raise and want to know whether you should keep it or put it in your 401K? If you don't NEED the 3%, I'd go with the 401K. Especially if you can borrow against it if needed in the future (my last job everything was 100% vested, including the company contribution). If you could use extra money and don't know if/when you might get another raise, the way I always did it is I put half my raise in my paycheck and half in the 401K.
Absolutely go with the 3% increase in your 401(k). There are tax benefits to the 401(k) which will work in your favor in a way that compounds over time. More importantly, it is critical to establish good habits about saving as early as you can. Being able to avoid lifestyle inflation is one of the key tools in your toolbox to achieving financial independence (security, retirement, whichever word you want). Get into the habit of sticking your pay increases into savings and your future self will thank you.