Let's say I have two wallets, each delegated to a different stake pool. At some point within an epoch I transfer some Ada from one wallet to the other. What will be the applicable balance which is considered staked by each wallet/pool for that epoch?
At the end of epoch
N the balance in your wallet becomes the staked balance for epoch
N + 2 and the staking rewards for epoch
N + 2 are paid at the start of epoch
N + 4.
This avoids the need to lock ADA up for staking and also gives the code enough time to do the required calculations before they are needed.