I have heard that if I sell my house one year, and don't use the money
earned to buy another house, I'd be taxed on the earnings as if it
were income.
When the law changed in 1997, the roll-over rule ended. Before that change if you put the gains into the next house you could defer the gains, until there was a lump sum provision once you sold after the age of 55.
Is there any way I can sell a house, hang onto the money for a future
house payment a few years in the future, without having to pay income
tax on it?
All this assumes that this was your principle residence, and it has been for at least 2 of the last 5 years. If it was or is a rental property the tax calculation becomes more complex.
You have to first figure if there are any gains, and if they are taxable. If you met the time requirement, and the gain was less than 250K or 500K (married filing jointly), there will not be any federal capital gains.
If the first approximation of the price you sold the house for minus the amount you paid for the house would exceed the 250K/500K exemption, then you have to look at the details. The details include closing costs involved with the two transactions, and any home improvements such as remodeling a bathroom, adding an addition.
IRS pub 523 has details regarding time lines and what counts as an improvement.
My workplace situation may require that I sell my house and move into
an employee-provided apartment.
One thing that was interesting was there still is a partial exclusion for a job related move:
Does Your Home Qualify for a Partial Exclusion of Gain?
If you don't meet the Eligibility Test, you may still qualify for a
partial exclusion of gain. You can meet the requirements for a partial
exclusion if the main reason for your home sale was a change in
workplace location, a health issue, or an unforeseeable event.
Work-Related Move
You meet the requirements for a partial exclusion if any of the
following events occurred during your time of ownership and residence
in the home.
You took or were transferred to a new job in a work location at least 50 miles farther from the home than your old work location. For
example, your old work location was 15 miles from the home and your
new work location is 65 miles from the home.
You had no previous work location and you began a new job at least 50 miles from the home.
Either of the above is true of your spouse, a co-owner of the home, or anyone else for whom the home was her or his residence.
Note: Ask your employer if the apartment they provide is considered taxable income. There are rules related to that situation.