What is the easiest way to figure out what time signature you wrote a song in? I am self-taught and have never had a lesson. It's hard for me to put it all together. I'm getting there though.
Tap along to the beat of the song. As you tap, try counting "1, 2, 3, 4, 1, 2, 3, 4, etc." as a way to check for 4/4 time. Then try counting "1, 2, 3, 1, 2, 3, etc." as a way to check for 3/4 time. When the beat restarts at 1, it should feel natural and there likely should be a slight accent/extra strength in those notes that occur on the "1" count. Additionally, often times, melodic lines will start on the "1" count and chords will change on the "1" count. If the 3/4 counting fails to meet all of these criteria, then the song isn't in 3/4.
In addition to this method--of trying out different counting sequences--the goal is to reach the point where you can almost immediately determine the time signature. This requires practice, and a good way to get that practice is by counting along to songs for which you do know the time signature. Count along to songs in 4/4, to some songs in 3/4, and even in odd time signatures like 5/4, 7/8, etc. As you count, pay attention to the qualities I described above--notice which beat the chords tend to change on, which beat melodic lines tend to begin on, etc. This will train your intuitions and make the task easier.
In general, the beat you naturally feel will be a quarter note (though not always). This makes the time signature X/4, where (a) the 4 in the denominator represents that you're counting quarter notes and (b) the X in the numerator is a numerical value indicating how many beats occur per measure before returning to the 1 beat. (For example, 3/4 indicates that you should count 1, 2, 3, 1, 2, 3, etc. whereas 4/4 indicates that you should count 1, 2, 3, 4, 1, 2, 3, 4, etc.) An eighth note is twice as fast as a quarter note, and if you want, you can assign the beat an eighth note duration. Assigning the beat to be an eighth note generally works best for fast songs.
Adding to jdjazz's excellent answer, along with the common 4/4 time (so common, it's often called 'common time', and the less frequently used 3/4 time (sometimes called waltz time), the next one to think about is two time.
It can be a straightforward march time - left, right, left, right, with beat one on the left count. In which case, it follows the pattern of 4/4, 3/4, to become, yes you've guessed, 2/4. But, you may discern a smaller 1,2,3, 1,2,3 inside. It's actually going to be 1,2,3, 4,5,6, with biggest emphasis on 1, and a smaller emphasis on 4, those being equal to left and right of earlier. As we're now counting faster, we can say the beats are quavers (eigths) so it gets written as 6/8, using the same concept as jdjazz mentioned.
When you get into the far rarer 5/4 or 7/4, these are usually subdivided: 5/4 can be 1,2,3, 1,2; 7/4 sometimes 1,2, 1,2, 1,2,3. There's no point generlly counting to more than 4before starting again at what you recognise as 'one' - the most emphasised beat of just about any time signature.
Having said that, watch out for reggae, as it pretty well trns these ideas on their heads. But that's for another day...
An answer to this question that holds up to any rigorous scrutiny would be incredibly difficult to write and would likely leave you with more questions than answers. With that in mind:
Time signatures serve to organize music in such a way that things repeat at predictable intervals. Finding a time signatute is, then, the process of finding the time signature that causes music to be organized in such a way that things repeat at predictable intervals.
There are two implications to this. The first is that you can actually count anything as anything. You can take something in 4/4 and count it in 23/16 if you really want to; you're just going to find the harmonic rhythm largely incomprehensible and the phrases are going to be very weird lengths. The second is that, despite the fact that you can count anything as anything, there's generally only one way to do it right and when there isn't it's because you can choose between two virtually indistinguishable time signatures.
So how do you actually do it? Well, you count. Count until things repeat. Pay attention also to phrases; things should repeat on a macro level at a logical interval, generally eight bars, but sometimes four, twelve or even six.
If you're listening to western music, it's going to be 4/4 90% of the time, and the remainder it's going to be almost always 3/4, 6/8 or 2/4 (in that order). You'll find composite time signatures - time signatures where the "numerator" is a prime number - especially if you go looking for them; such music is only rare in relative terms. You need to also watch out for compound meter, which is where beats are grouped into units of three. If you find yourself able to count to 6 and 2 (with a ratio of 3:1 between the two counts) you are probably listening to something in 6/8. The same thing applies if you can count to 12 or 4 (12/8).
Figuring out the "denomenator" is more complex and depends more on your general theory knowledge. I consider it secondary to the actual counting process, so I won't go into it too much, but a broad rule is that you want to pick the denominator that makes your tempo marking and notation reasonable while, as always, being aware of compound meter.
Easiest way... Listen to how the drummer starts the song. If he taps the high hat 1... 2... 3... and the song starts it is probably three time of some sort. If he goes 1... 2... 3... 4... It is probably four time of some sort.
Also listen carefully to how the beats are emphasized. Generally, but not always the emphasis will fall on the strong parts of the beat. On the first beat in 3 time, 1 and 3 for 4 time.