If the bill is changed in the Senate, it has to go back to the House of Representatives for a new vote (and vice versa). Other than that, there are no limitations upon the Senate as to how much it can change the bill. That said, the Senate itself has rules that limit changes in practice.
As an example, the Patient Protection & Affordable Care Act (PPACA; colloquially known as Obamacare) was originally a bill that had nothing to do with health care. The House passed a bill (House Resolution 3590) that included some kind of tax change. As such, it had to originate in the House (and did). The Senate took that bill, removed all the original text, and replaced the whole thing with the PPACA text. Even though PPACA included taxes, this was constitutional because the bill had originally had tax changes.
The Senate passed this bill with sixty votes (all members of the Democratic caucus). It went back to the House, which amended it and sent it back to the Senate. The Senate then used a process called Reconciliation to agree to the budget related changes made by the House with a simple majority vote.
Currently the House and Senate want to pass the American Health Care Act (AHCA) under Reconciliation. To do that, the bill must be a budget bill and can't make changes unrelated to the budget. This is why they can't make many of the changes that they want to make, e.g. selling insurance across state lines, in this bill. They expect to have to pass a separate bill later.
If there are sixty votes in the Senate, the Senate could change the entire bill. Without sixty votes, the Senate can only make Reconciliation compliant changes. Because sixty votes seems unlikely for this particular bill (AHCA), it is almost certain that they will thus limit amendments so as to be consistent with Reconciliation.
One of the issues during passage of PPACA was that it could be argued that it would impact Social Security. As this was not allowed under Reconciliation, a ruling to that effect would have sent the bill around for another round of amendments. The Senate Parliamentarian did not agree with that particular argument though.
They also have a separate option, often called the nuclear option. Basically that is that they would change the rules such that the bill could pass by a simple majority in the Senate. For various reasons, Senators are unlikely to do that, but it is possible for them to do. In particular, they have already "nuked" the sixty vote requirement for presidential nominations to judicial and executive branch nominations.
At the extreme, could they say completely re-write the bill so that it is no longer even about health care at all but about climate change (or just another unrelated issue altogether)?
Yes, absolutely. As the HR 3590 example shows, they could remove the entire text of the current bill and make the bill about military housing tax changes. If they did that, the bill would have to go back to the House for a new vote. Note that the same happens even if they make a much smaller change. Both chambers have to pass the same bill. Until they do so, the bill can't be sent to the president nor become law.