Are you talking of a connection within a LAN or are you trying to access a machine that sits behind a router from the www. In the latter case you may have to configure the router to forward port 22 to the machine you want to access.
In any event, for people here to be able to provide useful input it would be helpful if you posted the command you are running to connect to the machine and the output you get.
Also, on the target machine, run
and post the output so that we can see if you have any firewall rules that would block the connections.
What distro are you running on the target machine?