Most people go through at least a few positions over the course of their career. A popular survey from the Bureau of Labor Statistics, for example, found that baby boomers held 11.9 jobs from ages 18 to 50. But how long do you have to stay in one job before you pack it up and move on?

A general rule of thumb

Experts have mixed opinions on the "perfect" length to stay at a job. If you scour the Web, you'll find recommendations of anywhere from six months to six years. One to two years seems to be the minimum sweet spot. After that amount of time, you've likely passed reviews and established some rapport.

What can change how others see your resignation 

What's acceptable actually takes a lot of other factors into account.

1. Cost to your employer

Finding a new worker can be extremely costly. With expenses like sign-on bonuses, relocation costs and advertising fees, it's not unusual for a company to spend up between $1,000 and $5,000 to hire someone. Then you have to consider costs like training, too. One guideline is to leave only when you've provided a value to the company that is equal to those fees for your replacement. Otherwise, you're costing the company money, which can reflect badly on you.

Remember here that the cost of staying when things stink is much higher than hiring-related expenses. A Harris poll indicated that the cost of a bad hire was more than $25,000 for 41 percent of respondents and greater than $50,000 for 25 percent.

2. Smoothness of transition

Employee turnover can disrupt processes and decrease productivity. If you can help even out wrinkles your exit might create, such as by assisting with the candidate search or sticking around a few extra weeks to make sure your replacement is properly trained, your employer might not think as badly of it if you leave before a year or two.

3. The gig economy and what you achieved

Traditionally, job hopping on resumes has suggested that you couldn't find a good fit and weren't able to contribute well. It's also been seen as rude--companies don't want to be seen as secondary or only as a stepping stone to something better.

But the gig economy is changing all this. Temporary and flex workers, who often stay at a company for just a few months, have become essential to operations, with 2 out of 3 employers say they wouldn't survive without them. They are able to get jobs by proving over and over again that they stepped up and met unique needs.

If you can do the same thing and demonstrate your time was truly productive, hiring managers who understand this workforce shift might cut you some slack if they see shorter job durations. This is especially true if the industry you are applying in prizes or requires adaptability and flexibility. Lack of movement in those is more likely to be perceived as stagnation.

4. Your overall career vision

In many cases, there's simply no substitute for having a specific mentor, project experience or training. If you're getting those things at your current job, it might be worth it to hang in there a little longer to make sure you have the footing necessary to take the path you really want. But conversely, some jobs, like that extra weekend gig you use only to fill a financial hole, don't even need to be on your resume in the first place. Don't burn important bridges, and at the same time, if you do your homework/research and see your dream job right in front of you, most leaders will understand if you reach out and grab it.

5. How the company is using you

If you were hired to do certain tasks or projects and your duties have gone completely off the rails, or if you're sitting around waiting for jobs to do, you're probably worth more and would be happier at another business. It's fine to leave early if you've already discussed how you're utilized with management and they're not addressing the problem.

6. The number of candles on your birthday cake

If you're younger, leaving a job before six months to a year has passed can reinforce the negative stereotype that youthful employees don't have the drive or focus to be serious or considerate. You might do yourself a favor by staying for a while and showing that you're grounded. If you've been around the block, many hiring managers are more lenient. They often assume that, at that point, you've got the life experience and common sense enough to know what's best for you.

About 68 percent of millennials say the longest they'd stay in a job they enjoy is three years, and 58 percent say they plan to stay less than that. 41 percent of millennials expect to be in their current job for two years or less (compared to 17 percent of Gen X and 10 percent of Boomers).

The Bureau of Labor Statistics indicates that median tenure in the United States is 4.2 years, based on 2016 data. But you've got some flexibility in either direction. The biggest takeaways are that leaving shouldn't be purely an emotional decision, and that you should plan to stay at your next job a little longer if you do quit fast. As long as you can prove to your next employer that you're level-headed and don't make resignation an everyday habit, you'll be OK.