Yes, it happens automatically. You have equip slots for a ranged weapon, ammo, and left and right hand, in terms of weaponry. Your class determines if you can make use of all those slots. My test character is Assassin-class, so I have two one-handed swords equipped, a bow, and some barbed arrows. I'm like a cute swiss army knife.
And when the enemy comes into the "close range" radius, the character switches from the bow/gun to their dagger or sword or whatever they've got equipped in their L or R-hand slot. I don't know if there's a way to override it, aside from simply running out of range of the enemy again (a number of monsters seem to run faster than I do, but I also know there are movement speed boosting talents and skills, so you may be able to).
As far as classes go, everyone starts out as a novice, then soon after goes to one of four paths. The third step in each path is a branch where you'll choose a more defined role for yourself. The paths are:
Fighter --> Warrior --> Paladin or
Hunter --> Archer --> Ranger or
Acolyte --> Cleric --> Templar or
Spellcaster --> Mage --> Wizard or
Paladins are high-defense knights, Berserkers have crazy attack power. Rangers are long-range specialists, while Assassins are the primary dual-wielders (also with sneak-attacks). Templars appear to be the main healers, while Sages seem to be a bit broader in application (I don't know a ton about them myself, other than that they can transform into several creatures). Wizards are the prime offensive spellcasters, and Necromancers can, among other things, summon evil beasts to fight alongside them, making them a summoner of sorts. I've heard there is an additional progression later, but until I see evidence of it myself in the files, I can't say for certain.