If you are talking to someone in person, I would say "I worked for two years in a bakery." This is simple past, and sidesteps the question.
If you are specifically highlighting your experience, I would say "I have two years of experience in baking." The experience is something that, hopefully, stays with you. While your work at the bakery is past, your experience is still present.
It sounds like you are writing a resume. If so, the most important thing is that you pick one construction and use it all the way through, except on your current position.
For instance, in my resume, everything I currently do at my present job, I list in present tense. "Fax legal records; answer phones", etc. But for my past jobs I use all past tense. "Counted inventory, flipped burgers." Your "experience" question is kind of the exception, because experience is not something you lose. If I were writing your sentence for a past job on a resume, I would say "Gained experience in baking."
On another note, you can not have "experience in bakery." The use of the word bakery to mean the art of baking is archaic, and may never have been common. "Bakery" refers specifically to the building in which breads are baked, and takes an article. So you may have "experience in a bakery", or "experience baking", but not "experience in bakery".
On one final note, if you are writing a resume or something similar, you should definitely expand out to list more of what you did. Instead of "I have experience baking" try
I have two years of experience working in a small bakery. I have specific experience in creating both yeasted and sourdough breads, traditional flatbreads, and simple pastries. I am comfortable around hazardous baking equipment, and in the safety practices and fast pace required in the food industry.
I have two years of experience managing a small bakery. I have specific experience in managing supply chains, shrinking overhead, and screening new hires to create the best possible team. I managed a staff of six employees, and I oversaw the production of over a half-ton of baked goods a day, including yeasted and sour dough breads, traditional flatbreads and simple pastries.
Notice that in the first example it was all about experience and confidence gained, and so it was all in the past tense even though the job was in the past. In the second, Experience was listed in the present tense, but specific tasks that no longer apply are in the past tense.