Thanks for your letter, it was great to hear from you. I'm sorry I haven't written for months, but I had some personal problems.
It's really good news that you've passed your last exam. Congratulations!
Thank you so much for your invitation to stay with you for a week in July, I'd love to come. I know that you have a wonderful beach near your house, and I'll really enjoy spending some time there. I expect that the weather will be hot, so I hope we can go swimming.
You indicated that I don't need to bring much with me so should I pack casual or formal clothes?
I'm looking forward to seeing you in July and to having a great time.
Thanks again for the invitation.
All the best, Michael
I know you were probably just seeking grammatical advice, but from a social etiquette point of view I''d leave out the following sentences.
"I'd better stop now and get on with my studying."
That reads as though you are looking for an excuse for stopping writing and doesn't chime well with the general tone of the letter.
"Would you like me to bring anything for you? I would like to bring something special for you and your family."
Don't ask, just do it! It will be a surprise and appreciated all the more. Asking is merely watering down the relationship between you.