This really depends on whether the two houses of Congress tend to agree with each other at a given time or not. For example, during the first two years of Pres. Obama's term, the House and Senate have not worked all that well together. The House leadership is much more liberal than the Senate and so that causes problems. This means that a lot of the time the two houses don't really work together.
Ideally, the House and Senate leadership can work together to make sure that they are passing (or at least considering) similar bills. So that is one way they can work together. If they do pass different versions of the same bill, they also work together in conference committee to get their versions to be identical. That is another way they work together.
Of course, both houses must pass a bill in identical form for it to become a law.
If a bill originates in the House of Representatives, it is proposed by a representative. Then, the proposed legislation is sent to a committee; once the committee releases the legislation, the entire House considers the bill for the purpose of amending, debating, or voting on it. If it passes by a majority of votes (218 out of the total 435 representatives), it goes to the Senate, where a committee considers it. The bill can then be released to the entire Senate for debate or a vote, and it can be passed by a majority (51 out of 100 senators). The Senate and House work together at that point. A conference committee made up of both representatives from the House and Senators works together to iron out any differences between the House and Senate bills, and, if the revised bill is again passed by the House and by the Senate, it is sent to the president, who has ten days to either veto it or sign it into law. Bills can also originate in the Senate (except for bills for raising revenue, which must originate in the House).