It depends on your education and skills gap. If the gap you have to fill is wide, then it will take you a considerably longer time than when your education and skillset already match that of your new career.