Bisexuality is, when you have attraction to both men and women, while pansexuality is, when you are attracted to all of the genders (men, women, non-binary, trans and so on).
I'm sorry, I'm sure you mean well-- but this is a common misconception. Yes, some bisexuals are only attracted to men and women in the binary sense, but bisexuality doesn't automatically exclude non-binary or trans people--specifically since the latter are the respective genders they are/have transitioned to. Many bisexuals--myself included--are entirely capable of being attracted to non-cis and enby folks. As to your question, OP: Bisexuality is attraction to two or more genders. Pansexuality is attraction to all genders/regardless of gender. Typically, it's seen that bisexuals have a preference whereas pansexuals don't, but there are always exceptions. The individual pansexual can still have preferences between the genders and bisexuals may even not have a specific preference at all. To put it plainly, while they can be distinct to some people, they are interchangeable for others. It comes down to the individual bisexual/pansexual person, all of whom are as different as anyone of the gay, straight, or lesbian communities. So the difference, you'll often find, is case by case. I hope this helps some.
Thank you very much for the correction. I forgot to edit my text. I wanted to say men, women or more than one gender (trans, non-binary), but that part somehow got lost from my text.
I've always understood pansexuality as, not an attraction to all genders, but attraction to certain features or traits that are, not necessarily, defined by gender. My husband identifies as pan and he is most attracted to slim, androgynous body types and appearances, for example. It's tricky to define since it can be very broad, and the label will mean different things to different people.