It does take practice to get the feel of the rhythm. But if you can listen to a song and tap your finger to the beat on a table, then you have the skills needed to learn to play the guitar and keep the rhythm.
The strumming pattern you use will have an effect on your ability to maintain an appropriate rhythm for a particular song. On many patterns you may find it helpful to get your wrist moving up and down like a pendulum and keep it going much the same way as if you rest the heel of your hand on a table and tap your fingers to the beat. Depending on the strum pattern you might intentionally miss the strings on every other up-swing or every other down-swing or every third down swing etc. - depending on the strum pattern you want to use.
I think it might help you develop better rhythm if you practice strumming along to a backing track that has a drum and even the guitar part but is not cluttered with vocals and superfluous instrumentation that would otherwise mask the guitar rhythm.
I recently came across a great site which includes free midi backing tracks for thousands of songs to go along with the lead sheets and chord sheets. The lead sheet will tell you where to put your capo (if needed) to match the midi track. I have found an occasional chord wrong on a few songs but you can download the sheet and manually correct the chords and also download the midi file so you can play along. I have downloaded quite a few of the sheets and corresponding midi backing tracks.
The site is called Betty Lou's Guitar music site and it can be found at Site for free midi backing tracksSite for free midi backing tracks You should be able to find some songs you know on this site. Give it a try.
Don't give up, you will get it eventually and then you will wonder why you ever had any trouble because it will become natural. Good luck.