I put 100% of my 401k into an S&P index fund.
Do I need to rebalance that, or is rebalancing only necessary when you have multiple asset allocations such as 80% in stock, and 20% in bonds and then you rebalance to keep that same allocation.
There's nothing to rebalance, the index fund rebalances itself to continue matching the index.
However, you need to understand that such an investment is not diversified and you only invest in a very specific market, and very specific stocks on that market. S&P 500 is large (500 different companies, most of the time), but still not as broadly diversified as your retirement investment portfolio should be.
You should talk to a financial adviser (CFP for example), many companies provide access to these for 401k plan participants. But in any case, I'd suggest considering "target date" funds - funds that are investing based on your expected retirement year, and become more conservative as you get closer to that year.
Rebalance is across asset-classes which are mutually independent [like stocks and bonds; they may be inversely correlated at times as when stocks go down, bonds go up]
80%-20% (stock-bond) split is good for a young investor [say in 30s, some suggest 110-age as a good stock allocation percentage].
Here rebalance is done when say the asset-allocation(AA) strays away more than say 3 to 5% (again just a rule of thumb). E.g. if due to a recent run-up in stocks, AA could become 85%-15%. Then you sell stocks to buy bonds to make the AA 80%-20%
And since this method always sells the winner -- you automatically make gains [selling high and buying low]
S&P 500 index gives decent diversification within stocks; you want a total-bond-fund to take care of the bond side of your AA.