I agree with
@woootbm that total time spent battling is probably more important than the number of turns per battle (although it's also important not to let any individual, regular encounter go on too long either).
A rule of thumb I like to aim for is that any major form of engaging the player should have about the same amount of total time in your game as the other major forms of engagement - and anything that doesn't represent a major form of engagement (think walking, buying equipment, using consumables, searching for plot flags, etc.) should have its total time kept to a minimum. And the sweet spot for how much time the player should spend with one type of engagement before switching to another type is usually 10-20 minutes for RPGs (and less for other genres, like platformers or party games).
More directly on-topic, this means that the number of turns an encounter should last depends on how long each turn takes (longer turns should mean fewer turns) and how many encounters you are throwing at the average player (more encounters should mean fewer turns).
As a player, I tend to enjoy pretty quick ordinary encounters, with most of them able to be taken down in a single turn if played well (or 2-3 turns if not played as well), some able to be taken down with a single
action, and some able to last several turns against you and make you feel a real sense of danger if you do something wrong.
The main reason I tend to like most battles ending so quickly is so that "decided" fights (the ones where the outcome is already clear and the enemies can't do anything significant to you anymore) don't drag on for more than a few seconds. Once a fight is decided, it's no longer interesting or engaging. As a designer, do everything you can to tease a wide variety of possible outcomes for as long as possible during a battle, and have the battle resolve very quickly once it's clear who will win and by how much.
(Note that unless you're healing the party to full after each battle automatically, a clean win and a pyrrhic victory are two very different outcomes, and if either one is still very possible, you don't need to rush things to their conclusion.)
For bosses, I tend to like 8-12 turns as a sweet spot, with the 2-3 most major storyline bosses feeling more epic at 12-20 turns. But again, it depends on turn length and it also depends on the mechanics of the fight -
the main thing to avoid is having your player repeat the same actions turn after turn after turn. If you can avoid that, and can continue to surprise your player a bit, your boss battle isn't too long (again, though, keep it below 20 minutes to avoid burnout). If your player is inputting the same commands over and over, your boss battle has gone on too long.