All filters are sized by numbers, measured in millimeters (mm) This has no relation to the focal length, also expressed in mm. And most lenses have a certain size filter they are made for. The larger the number, the larger diameter the filter is.
You can always get an adapter ring to put a filter on a lens that's not the same size. You can always put a 77mm filter on a lens with a smaller filter thread, but if you put a smaller filter on a lens with a larger filter thread, you can start to cause vignetting (darkening of the image corners).
Not all lenses take filters in the front. Some ultra-wide and fisheye lenses don't. Some lenses take rear-mount gel filters, and some long telephotos use drop-in filters.
Check the manual that came with your lens, or check the manufacturer's website, for the size of filter a particular lens requires.