Yes, they can move out if you're away from the game for a long period of time. There are ways to prevent this, though. One option if you time travel is to note the last date you played and the next time you log in to New Leaf set the date to that date or the day after.
I've also heard that if you stop someone from moving on the last day that you play, then you can safely take a hiatus and no villager will move out while you're gone. I can't vouch for that method personally, though, as I've never tried it.