Most Helpful Girl
Only tell them something like this if they ask, "Where do you see yourself in 2 years" or "what goals do you have?" because employers actually will ask this to gauge what kind of ambition you have, and they DO want to see that you have ambition rather than say you intend to live out your life in their entry-level job. Otherwise, if nothing is asked, no need to tell them. First of all because it's your business to know right now, and secondly two years is a long time away.
Now if you're applying for a job where they expect more than a two year commitment, they likely will ask this, and it would be a good idea to tell them. So this means if they are going to train you with pay and continue training you with pay down the road. If you have some contractual obligation, you'll have to pay it back if you leave.
I have no idea where you're apply to work, but if it's just a regular job in retail, food, reception/admin work, then most people don't even last in those jobs more than six months. So I think you're fine to keep it to yourself, and truthfully let them know what your ambitions are only if asked.0