The 22nd Street Caltrain station is one of three Caltrain stations in San Francisco, serving Potrero Hill and the Dogpatch. The other two are:

The official Caltrain page for 22nd St. Station has handy time tables. Not all trains stop at 22nd Street, but many do.

If you are trying to take your bike southbound, you might have better luck getting on at 4th and King, or taking a local train.

You can find the 22 Fillmore and 48 Quintara buses not too far away. You might also walk to the T Third trolley line. But if you're going north, you should probably stay on until 4th and King.