Unfortunately, you don't just get a check in the mail the moment you accept an offer from a publisher to publish your book. The contract has to be negotiated, which can take months. Then both parties need to sign the agreement, and then finally a check gets cut.
But according to most agency agreements and agency clauses in your contracts, the check is made out in the name of your agent and gets sent to them. Your agent will then deposit the check in an account, take out their commission (usually fifteen percent) and any expenses they incurred in submitting your work (typically copying, postage, and messenger fees), and then send you your payment. According to the Association of Authors' Representatives, agent members must send payments due to their clients within ten days after it's cleared.
Most agency clauses (including the one I use) state that an agent is entitled to their commission for the life of the contract, regardless of whether the author ceases to be a client. But if you and your agent do part ways, you and your former agent can request that the publisher send the commission to the agent and the rest directly to you.