It's best to connect two batteries together that are the same type, size, and age. Batteries that are different recharge in different time periods - for example, a small battery might be overcharged when a larger battery still needs more charging. A group 24 battery may be in the range of 75AH and a group 31 battery in the range of 120 AH. So the group 31 battery needs quit a bit more charging (at the same rate) than a group 24.
However, practically speaking connecting in parallel a group 31 and a Group 24 wet cell battery will work OK - just keep an eye on the water level in the group 24 in case you need to add distilled water. And the additional battery will extend your run time. It's probably a good idea to replace the group 24 with a group 31 when and if you can.
There's lots of advice and information in forums... sometimes it is correct. For example, all of my posts are made by a political appointee who got the job as a reward for contributions to my diesel bill.
2011 Jayco 28.5RLS; 2008 Chevy Duramax; Pullrite Superglide Hitch