Does the "divorce deal" have to be agreed by both the Commons and the Lords? If it does and the Lords reject it, what happens then?
It must. And the House of Commons can basically overrule the House of Lords if the latter gets in its way.
The House of Lords debates legislation, and has power to amend or reject bills. However, the power of the Lords to reject a bill passed by the House of Commons is severely restricted by the Parliament Acts. Under those Acts, certain types of bills may be presented for the Royal Assent without the consent of the House of Lords (i.e. the Commons can override the Lords' veto). The House of Lords cannot delay a money bill (a bill that, in the view of the Speaker of the House of Commons, solely concerns national taxation or public funds) for more than one month.
Other public bills cannot be delayed by the House of Lords for more than two parliamentary sessions, or one calendar year. These provisions, however, only apply to public bills that originate in the House of Commons, and cannot have the effect of extending a parliamentary term beyond five years. A further restriction is a constitutional convention known as the Salisbury Convention, which means that the House of Lords does not oppose legislation promised in the Government's election manifesto.
Denis has given the formal answer, but there is also a political reason why the House of Lords will not block a deal.
The House of Lords is unelected, and the Lords are aware that the existence of their institution is controversial. If, after years of Brexit drama, the House of Commons were to finally pass a Withdrawal Agreement, only to be rejected by the House of Lords, there would be a major uproar, potentially to the level that the existence of the House of Lords may be under threat, but at least to the level that their powers may be severely curtailed further. For that reason alone, for such an important and controversial piece of legislation, the House of Lords will not block it when it has passed the House of Commons. It would be suicidal.
No. Only the House of Commons needs to agree the deal. The Lords has to debate it, but does not have to vote in favour of it.
The Brexit deal is not legislation, it is an international treaty between the UK and the EU. Therefore the process for bills is irrelevant. That said, following the Brexit deal (if any) there will be legislation needed in order to actually enact the various things it says the UK will do, and that legislation will need to be passed in the usual way. This is why the government and the EU agreed that in the event of the deal being approved, Brexit will be delayed until the 22nd of May. It gives Parliament some time to prevent a harmful legal gap in which what the UK has agreed to do is not actually legislated for. But those votes are to find out whether (and with what details) the UK keeps to its treaty obligations, not to find out whether the UK signs and ratifies the treaty and leaves the EU.
Ordinarily, treaties do not have to be voted for by both Houses, they merely need to not be voted against by either House. You can decide for yourself whether failing to vote against something counts as "agreeing" it. There are various circumstances under which a treaty might never be voted on at all (the most likely being that neither government nor opposition considers it to be worth spending their parliamentary time on, which of course would not apply in this case!). If there's no vote, the treaty is ratified.
However, specifically for the Brexit deal, Section 13 of the European Union (Withdrawal) Act 2018 (as amended by Grieve's business motion in November 2018) requires that the government places an amendable motion, the so-called "meaningful vote", before the House of Commons, and that the motion is passed by the House of Commons. It also requires that the government places a motion before the House of Lords, but that only has to be debated (on government time), not passed. You might ask what's the point of only requiring it's debated, but basically this is using the Lords in its role as an advisory body. It's up to the Commons to decide whether or not to take note of what the Lords say in their debate. But at the very least, the EU Withdrawal Act means the opposition doesn't need to find time for that debate, because it has to be a government motion.