Playing on both systems requires two purchases of the game, one for each platform. But yes, you can apply both purchases to the same account and then play the same account / same character(s) from both platforms. You also get 30 days of subscription time from each of the two purchases, so that's a total of 60 rather than 30 days included with purchase before you have to pay additional subscription fees. (And then those subscription fees are for the account as a whole, regardless of which platforms are unlocked for it.)

There are some things, like gear sets, macros, hotbar setups, and UI layout, that are stored locally, and will have to be set up again for each system you play on. This isn't much of an issue if you're planning on transferring once from one system to another, but can become an annoyance if you plan on using both regularly, alternating between them, as you'll have to re-do any changes to gear sets, etc. both places.