The process and length of time for each depends on your own individual level of knowledge and time you need to prepare/study. An example could be three to six months preparation (or shorter or longer). They are very different (although some information will cross both certifications). Also depends on the certifying agency because some are more difficult than others.
Do you have a background in any type of fitness? What is your passion and what do you want to do? Determine what you want to do first and then decide which certification to go for…
For me, personal training took more time.
When I started out in group exercise, the longest training that I had was a 56 hour in-house training for a small chain of fitness centers in my state. In that 56 hours, we had book learning and practical experience. After that, we had an all-day exam, both written and practical. Nothing I’ve done for group-ex since has come anywhere even close. I studied for about 8 hours for AFAA plus the one-day AFAA course itself. NDEITA was done in one day. YMCA group fitness leader was one day. YMCA fitness instructor was 2 days.
Personal training, I took about 100 hours to study for the ACE exam, reading it cover to cover and making my own flash cards. I already knew much of the anatomy and physiology from group-ex, so the bulk of the study was on assessment and individualized program design. Then it took me another 60 or 70 hours to go through the NASM book cover to cover.