I have water puddle next to my foundation when it rains. I dug this trench to try to get the water to not puddle around the foundation. I also put some soil around the foundation. Does this look okay?
Without some sort of retention, that trench will likely cave in or mud up.
Using the existing trench, you can improve it with a bit of effort:
Dig the trench a bit deeper and lay some "big-o" black plastic underground pipe, running from the spout to wherever it can empty down hill. Get the non-perforated kind. Cover the pipe with soil, dirt, rocks or anything to hold it in place. A catch basin at the entry is recommended, but for your short run it might be fine to just feed the spout into the pipe end. Keep the feed point above ground, and make sure you have decent slope, 1 to 2in per 4ft run.
Alternatively, create a open-top pipeless gravel drain, a.k.a a french drain. Lay some landscape fabric or filter fabric in the trench, and fill with 1.5in round rock. Depending on the volume of water from that spout this could work without the usual embedded drainage pipe. The round rock will prevent the trench from caving in. This is not ideal in general, but could work well in your case.
No. You don't specify where you are so it's hard to know what kind of water you deal with, but this is something I've had to learn due to the amount of precipitation I deal with (you will all be envious of that soon, I'm sure.)
In any event: you don't want water from your downspouts anywhere near your foundation. From your picture: too close!
There are a number of options, but the right option depends mainly on what you deal with from a precipitation perspective. I would recommend a rain-barrel first off, if you have light to medium precipitation. If you have heavy precipitation e.g.: Seattle, you should be looking at swales or solid pipe drainage.