If you become an airline pilot, there's a good chance you will at some point become a commuter. Commuting is probably more prevalent among pilots than in the general population, since they can travel from their homes to their bases on their company's planes as pass-riding passengers on in the cockpit on jump seats. Reciprocal jump seat agreements make it fairly easy to obtain a jump seat on another carrier.
There are several scenarios of commuting situations. If you reside in a city where your airline has a base, but you are currently based at a different location, you may decide to commute to your base, rather than relocate. At some point, you may become senior enough to be based where you live. In this case, there is a light at the end of the tunnel.
In another example, perhaps you reside in a city where your airline does not have a pilot base. In this case, you will be a commuter for the duration of your employment, unless and until the airline establishes a base where you live. There is no light at the end of the tunnel.
When you commute, you typically must plan for several backup flights to get yorself to work, since your airline expects you to be in position when you're needed. And you have to be well-rested. That means you probably need to obtain accommodations at your base.
Many pilots obtain crash pads, where they pay a fairly reasonable price to share a sleeping space with other commuting pilots. The other option, unless you have a friend in the new city who will allow you to camp out at their house, is to get an apartment in the city where you're based, or get a hotel room for every trip.
In another model, perhaps your airline provides positive-space air transportation and hotel room prior to your beginning your flight schedule. In this case, you still need to spend a lot of time away from home simply traveling to your employment, but the problem of uncertainty about your transportation is solved.
If you're commuting simply to get seniority in a base, or get more pay due to a promoted position, you need to give a lot of thought to the heavy price you'll pay.
For more information, read the blog post "The Commuter's Survival Kit".