I am trying to create a pattern for tiles.
So, I have a specific width and height and I want to fill it with rectangles and leave space for grout.
Then I want to fill every rectangle with the same image.
Here's a rough sketch:
I would do this in Illustrator.
Simply draw a rectangle the size you want, then choose
Object > Path > Split Into Grid and enter the number of tiles horizontally and vertically (rows and columns) along with any gutters (grout) area.
Copy and paste into Photoshop if that's where you need it.
As far as I'm aware, the only similar feature in Photoshop...
If you must use only Photoshop, you can create a guide layout - which will essentially set up guides in a similar manner without actual paths or shapes - then use that to draw shapes.
Beyond this, for only Photoshop, and for any version prior to Photoshop CC, you'll need to measure and manually figure out tile sizes.
here is my solution using photoshop
Filers > others > offsetand choose some values that is smaller than the original document dimensions. (in my example my document where 500px square .. I do offset from 300px).
Edit > define pattern...and type a proper name for your new pattern.