Hi Jim,
You have asked one of the trickest questions in harvesting from a home garden. It can be difficult to get them just right. I have never had any success with thumping the melon so I won't even bother suggesting that. For watermelons look for a yellow spot on the underside of the melon. Since I started using that as a guide I have had pretty good melons. Also look for the tendril nearest the stem to turn dry and brown. The outside of the watermelon will take on a dull appearence.
For melons look for the outside of the melon to take on the appearence of a mature fruit. Depending on the cultivar you are growing this could be tan with netting or the right color of green for a honeydew. Look at the pictures on the seed packet or catalog if possible for reference. Also the melon should slip easily from the vine along with a small crack in the fruit around the stem. Muskmelons should have a strong scent. The area around the stem will 'give' slightly under pressure. Melons can ripen further in the house if you need to pick a little earlier than perfect.
Here is an extra tip for melon growing. Wireworms, slugs or other pests try to tunnel into the underside of the fruit. Use small cans to lay them on as they are growing, such as tuna or cat food cans, to get them up off the ground.
Happy Gardening,
Diane